summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-27 10:48:30 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-27 11:07:32 +0100
commitfe3566e190592151da285b2b995191923260c59e (patch)
tree5575f1d4e2ef42a8d593ae672b6429d1726fec4f /main/main.cpp
parent5f1107aa30295e686be6f41cb6d17fc2cff1e036 (diff)
DisplayServer: Fix registration of GetRenderingDriversFunction
Also improve `--help` output.
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/main/main.cpp b/main/main.cpp
index bc97f9f8c5..9e7e0e8842 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -271,16 +271,22 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --render-thread <mode> Render thread mode ('unsafe', 'safe', 'separate').\n");
OS::get_singleton()->print(" --remote-fs <address> Remote filesystem (<host/IP>[:<port>] address).\n");
OS::get_singleton()->print(" --remote-fs-password <password> Password for remote filesystem.\n");
- OS::get_singleton()->print(" --audio-driver <driver> Audio driver (");
+
+ OS::get_singleton()->print(" --audio-driver <driver> Audio driver [");
for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) {
- if (i != 0)
+ if (i > 0) {
OS::get_singleton()->print(", ");
+ }
OS::get_singleton()->print("'%s'", AudioDriverManager::get_driver(i)->get_name());
}
- OS::get_singleton()->print(").\n");
- OS::get_singleton()->print(" --display-driver <driver> Display driver (and rendering driver):\n");
+ OS::get_singleton()->print("].\n");
+
+ OS::get_singleton()->print(" --display-driver <driver> Display driver (and rendering driver) [");
for (int i = 0; i < DisplayServer::get_create_function_count(); i++) {
- OS::get_singleton()->print("\t\t'%s' (", DisplayServer::get_create_function_name(i));
+ if (i > 0) {
+ OS::get_singleton()->print(", ");
+ }
+ OS::get_singleton()->print("'%s' (", DisplayServer::get_create_function_name(i));
Vector<String> rd = DisplayServer::get_create_function_rendering_drivers(i);
for (int j = 0; j < rd.size(); j++) {
if (j > 0) {
@@ -288,9 +294,11 @@ void Main::print_help(const char *p_binary) {
}
OS::get_singleton()->print("'%s'", rd[j].utf8().get_data());
}
- OS::get_singleton()->print(")\n");
+ OS::get_singleton()->print(")");
}
- OS::get_singleton()->print(" --rendering-driver <driver> Rendering driver (depends on display driver).\n");
+ OS::get_singleton()->print("].\n");
+ OS::get_singleton()->print(" --rendering-driver <driver> Rendering driver (depends on display driver).\n");
+ OS::get_singleton()->print("\n");
#ifndef SERVER_ENABLED
OS::get_singleton()->print("Display options:\n");
@@ -340,7 +348,7 @@ void Main::print_help(const char *p_binary) {
#ifdef DEBUG_METHODS_ENABLED
OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n");
#endif
- OS::get_singleton()->print(" --test <test> Run a unit test (");
+ OS::get_singleton()->print(" --test <test> Run a unit test [");
const char **test_names = tests_get_names();
const char *comma = "";
while (*test_names) {
@@ -348,7 +356,7 @@ void Main::print_help(const char *p_binary) {
test_names++;
comma = ", ";
}
- OS::get_singleton()->print(").\n");
+ OS::get_singleton()->print("].\n");
#endif
}