summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/main/main.cpp b/main/main.cpp
index c6d3c3f15c..04ed902c28 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -45,6 +45,7 @@
#include "input_map.h"
#include "io/resource_loader.h"
#include "scene/main/scene_tree.h"
+#include "servers/arvr_server.h"
#include "servers/audio_server.h"
#include "io/resource_loader.h"
@@ -82,6 +83,7 @@ static InputMap *input_map = NULL;
static bool _start_success = false;
static ScriptDebugger *script_debugger = NULL;
AudioServer *audio_server = NULL;
+ARVRServer *arvr_server = NULL;
static MessageQueue *message_queue = NULL;
static Performance *performance = NULL;
@@ -162,6 +164,7 @@ void Main::print_help(const char *p_binary) {
#endif
OS::get_singleton()->print(" -l, --language <locale> Use a specific locale (<locale> being a two-letter code).\n");
OS::get_singleton()->print(" --path <directory> Path to a project (<directory> must contain a 'project.godot' file).\n");
+ OS::get_singleton()->print(" -u, --upwards Scan folders upwards for project.godot file.\n");
OS::get_singleton()->print(" --main-pack <file> Path to a pack (.pck) file to load.\n");
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");
@@ -290,6 +293,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String video_driver = "";
String audio_driver = "";
String game_path = ".";
+ bool upwards = false;
String debug_mode;
String debug_host;
String main_pack;
@@ -498,6 +502,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->print("Missing relative or absolute path, aborting.\n");
goto error;
}
+ } else if (I->get() == "-u" || I->get() == "--upwards") { // scan folders upwards
+ upwards = true;
} else if (I->get().ends_with("project.godot")) {
String path;
String file = I->get();
@@ -695,7 +701,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#endif
- if (globals->setup(game_path, main_pack) != OK) {
+ if (globals->setup(game_path, main_pack, upwards) != OK) {
#ifdef TOOLS_ENABLED
editor = false;
@@ -935,11 +941,14 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
OS::get_singleton()->set_window_position(init_custom_pos);
}
- //right moment to create and initialize the audio server
+ // right moment to create and initialize the audio server
audio_server = memnew(AudioServer);
audio_server->init();
+ // also init our arvr_server from here
+ arvr_server = memnew(ARVRServer);
+
OS::get_singleton()->set_use_vsync(use_vsync);
register_core_singletons();
@@ -1341,7 +1350,7 @@ bool Main::start() {
String stretch_mode = GLOBAL_DEF("display/window/stretch/mode", "disabled");
String stretch_aspect = GLOBAL_DEF("display/window/stretch/aspect", "ignore");
Size2i stretch_size = Size2(GLOBAL_DEF("display/window/size/width", 0), GLOBAL_DEF("display/window/size/height", 0));
- int stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1);
+ real_t stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1.0f);
SceneTree::StretchMode sml_sm = SceneTree::STRETCH_MODE_DISABLED;
if (stretch_mode == "2d")
@@ -1771,6 +1780,11 @@ void Main::cleanup() {
memdelete(audio_server);
}
+ if (arvr_server) {
+ // cleanup now before we pull the rug from underneath...
+ memdelete(arvr_server);
+ }
+
unregister_driver_types();
unregister_module_types();
unregister_scene_types();