diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/main/main.cpp b/main/main.cpp index 0651f4b93f..02c3dffd11 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -986,11 +986,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "-d" || I->get() == "--debug") { debug_uri = "local://"; OS::get_singleton()->_debug_stdout = true; -#if defined(DEBUG_ENABLED) && !defined(SERVER_ENABLED) +#if defined(DEBUG_ENABLED) } else if (I->get() == "--debug-collisions") { debug_collisions = true; } else if (I->get() == "--debug-navigation") { debug_navigation = true; + } else if (I->get() == "--debug-stringnames") { + StringName::set_debug_stringnames(true); #endif } else if (I->get() == "--remote-debug") { if (I->next()) { @@ -1078,7 +1080,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #else const String error_msg = "Error: Couldn't load project data at path \"" + project_path + "\". Is the .pck file missing?\nIf you've renamed the executable, the associated .pck file should also be renamed to match the executable's name (without the extension).\n"; OS::get_singleton()->print("%s", error_msg.ascii().get_data()); - DisplayServer::get_singleton()->alert(error_msg); + OS::get_singleton()->alert(error_msg); goto error; #endif @@ -1087,6 +1089,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Initialize user data dir. OS::get_singleton()->ensure_user_data_dir(); + ResourceUID::get_singleton()->load_from_cache(); // load UUIDs from cache. + GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60); ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/multithreaded_server/rid_pool_prealloc", PropertyInfo(Variant::INT, @@ -2013,6 +2017,7 @@ bool Main::start() { // Let's throw an error gently. The code leading to this is pretty brittle so // this might end up triggered by valid usage, in which case we'll have to // fine-tune further. + OS::get_singleton()->alert("Couldn't detect whether to run the editor, the project manager or a specific project. Aborting."); ERR_FAIL_V_MSG(false, "Couldn't detect whether to run the editor, the project manager or a specific project. Aborting."); } #endif @@ -2042,9 +2047,8 @@ bool Main::start() { if (obj) { memdelete(obj); } - ERR_FAIL_V_MSG(false, - vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", - script)); + OS::get_singleton()->alert(vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", script)); + ERR_FAIL_V_MSG(false, vformat("Can't load the script \"%s\" as it doesn't inherit from SceneTree or MainLoop.", script)); } script_loop->set_initialize_script(script_res); @@ -2063,7 +2067,7 @@ bool Main::start() { if (obj) { memdelete(obj); } - DisplayServer::get_singleton()->alert("Error: Invalid MainLoop script base type: " + script_base); + OS::get_singleton()->alert("Error: Invalid MainLoop script base type: " + script_base); ERR_FAIL_V_MSG(false, vformat("The global class %s does not inherit from SceneTree or MainLoop.", main_loop_type)); } script_loop->set_initialize_script(script_res); @@ -2077,7 +2081,7 @@ bool Main::start() { if (!main_loop) { if (!ClassDB::class_exists(main_loop_type)) { - DisplayServer::get_singleton()->alert("Error: MainLoop type doesn't exist: " + main_loop_type); + OS::get_singleton()->alert("Error: MainLoop type doesn't exist: " + main_loop_type); return false; } else { Object *ml = ClassDB::instantiate(main_loop_type); @@ -2167,8 +2171,8 @@ bool Main::start() { } } - for (List<Node *>::Element *E = to_add.front(); E; E = E->next()) { - sml->get_root()->add_child(E->get()); + for (Node *E : to_add) { + sml->get_root()->add_child(E); } } } |