summaryrefslogtreecommitdiff
path: root/modules/openxr
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-07-24 20:43:30 +1000
committerBastiaan Olij <mux213@gmail.com>2022-07-28 11:50:34 +1000
commit1dd671014bdfc714687f91914755ad925aabda5f (patch)
tree4c03669e8695c9900dfe1b6fe8b26c8757bbeb29 /modules/openxr
parenteac22e3eb489b4a50bb274f10e8a8d4eb795fa99 (diff)
Add startup flag to override XR mode settings
Diffstat (limited to 'modules/openxr')
-rw-r--r--modules/openxr/openxr_api.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp
index 938b017e3a..92d074cb75 100644
--- a/modules/openxr/openxr_api.cpp
+++ b/modules/openxr/openxr_api.cpp
@@ -58,19 +58,14 @@ bool OpenXRAPI::openxr_is_enabled(bool p_check_run_in_editor) {
// @TODO we need an overrule switch so we can force enable openxr, i.e run "godot --openxr_enabled"
if (Engine::get_singleton()->is_editor_hint() && p_check_run_in_editor) {
-#ifdef TOOLS_ENABLED
// Disabled for now, using XR inside of the editor we'll be working on during the coming months.
return false;
-
- // bool enabled = GLOBAL_GET("xr/openxr/in_editor"); // EDITOR_GET("xr/openxr/in_editor");
- // return enabled;
-#else
- // we should never get here, editor hint won't be true if the editor isn't compiled in.
- return false;
-#endif
} else {
- bool enabled = GLOBAL_GET("xr/openxr/enabled");
- return enabled;
+ if (XRServer::get_xr_mode() == XRServer::XRMODE_DEFAULT) {
+ return GLOBAL_GET("xr/openxr/enabled");
+ } else {
+ return XRServer::get_xr_mode() == XRServer::XRMODE_ON;
+ }
}
}