diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-08-03 16:59:18 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-08-03 17:45:50 +0200 |
commit | 09386ba9fd6abddb3b9be723ae3650c6d15bc440 (patch) | |
tree | 9214338056aca966e0e10ce26e7697674afc6c3a /main | |
parent | 80fc90e82a57e8111cb7577b05bb2de021000e75 (diff) |
[Headless] Add --headless switch (no rendering, no audio).
Also remove now unused "--no-window" option, and relative OS getter and
setter.
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/main/main.cpp b/main/main.cpp index 92ab52eecd..d91cc5c9bf 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -326,9 +326,10 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --text-driver <driver> Text driver (Fonts, BiDi, shaping)\n"); + OS::get_singleton()->print(" --headless Enable headless mode (--display-driver headless --audio-driver Dummy). Useful for servers and with --script.\n"); + OS::get_singleton()->print("\n"); -#ifndef SERVER_ENABLED OS::get_singleton()->print("Display options:\n"); OS::get_singleton()->print(" -f, --fullscreen Request fullscreen mode.\n"); OS::get_singleton()->print(" -m, --maximized Request a maximized window.\n"); @@ -337,11 +338,9 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --resolution <W>x<H> Request window resolution.\n"); OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n"); OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS and Windows only).\n"); - OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n"); OS::get_singleton()->print(" --single-window Use a single window (no separate subwindows).\n"); OS::get_singleton()->print(" --tablet-driver Pen tablet input driver.\n"); OS::get_singleton()->print("\n"); -#endif OS::get_singleton()->print("Debug options:\n"); OS::get_singleton()->print(" -d, --debug Debug (local stdout debugger).\n"); @@ -352,7 +351,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --gpu-abort Abort on GPU errors (usually validation layer errors), may help see the problem if your system freezes.\n"); #endif OS::get_singleton()->print(" --remote-debug <uri> Remote debug (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007).\n"); -#if defined(DEBUG_ENABLED) && !defined(SERVER_ENABLED) +#if defined(DEBUG_ENABLED) OS::get_singleton()->print(" --debug-collisions Show collision shapes when running the scene.\n"); OS::get_singleton()->print(" --debug-navigation Show navigation polygons when running the scene.\n"); #endif @@ -728,7 +727,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->print("Missing video driver argument, aborting.\n"); goto error; } -#ifndef SERVER_ENABLED } else if (I->get() == "-f" || I->get() == "--fullscreen") { // force fullscreen init_fullscreen = true; @@ -818,10 +816,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--low-dpi") { // force low DPI (macOS only) force_lowdpi = true; - } else if (I->get() == "--no-window") { // disable window creation (Windows only) + } else if (I->get() == "--headless") { // enable headless mode (no audio, no rendering). + + audio_driver = "Dummy"; + display_driver = "headless"; - OS::get_singleton()->set_no_window_mode(true); -#endif } else if (I->get() == "--profiling") { // enable profiling use_debug_profiler = true; |