1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Add startup flag to override XR mode settings

This commit is contained in:
Bastiaan Olij
2022-07-24 20:43:30 +10:00
parent eac22e3eb4
commit 1dd671014b
5 changed files with 52 additions and 11 deletions

View File

@@ -343,6 +343,7 @@ 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(" --single-window Use a single window (no separate subwindows).\n");
OS::get_singleton()->print(" --xr-mode <mode> Select XR mode (default/off/on).\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Debug options:\n");
@@ -1181,6 +1182,25 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->disable_crash_handler();
} else if (I->get() == "--skip-breakpoints") {
skip_breakpoints = true;
} else if (I->get() == "--xr-mode") {
if (I->next()) {
String xr_mode = I->next()->get().to_lower();
N = I->next()->next();
if (xr_mode == "default") {
XRServer::set_xr_mode(XRServer::XRMODE_DEFAULT);
} else if (xr_mode == "off") {
XRServer::set_xr_mode(XRServer::XRMODE_OFF);
} else if (xr_mode == "on") {
XRServer::set_xr_mode(XRServer::XRMODE_ON);
} else {
OS::get_singleton()->print("Unknown --xr-mode argument \"%s\", aborting.\n", xr_mode.ascii().get_data());
goto error;
}
} else {
OS::get_singleton()->print("Missing --xr-mode argument, aborting.\n");
goto error;
}
} else {
main_args.push_back(I->get());
}