diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/main/main.cpp b/main/main.cpp index 71dd3cf1ad..9c8909f8fb 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -538,8 +538,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Only flush stdout in debug builds by default, as spamming `print()` will // decrease performance if this is enabled. - GLOBAL_DEF("application/run/flush_stdout_on_print", false); - GLOBAL_DEF("application/run/flush_stdout_on_print.debug", true); + GLOBAL_DEF_RST("application/run/flush_stdout_on_print", false); + GLOBAL_DEF_RST("application/run/flush_stdout_on_print.debug", true); GLOBAL_DEF("debug/settings/crash_handler/message", String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues")); @@ -1174,6 +1174,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph _print_line_enabled = false; } + Logger::set_flush_stdout_on_print(ProjectSettings::get_singleton()->get("application/run/flush_stdout_on_print")); + OS::get_singleton()->set_cmdline(execpath, main_args); GLOBAL_DEF("rendering/driver/driver_name", "Vulkan"); @@ -1742,6 +1744,19 @@ Error Main::setup2(Thread::ID p_main_tid_override) { register_scene_types(); +#ifdef TOOLS_ENABLED + ClassDB::set_current_api(ClassDB::API_EDITOR); + EditorNode::register_editor_types(); + + ClassDB::set_current_api(ClassDB::API_CORE); + +#endif + + MAIN_PRINT("Main: Load Modules, Physics, Drivers, Scripts"); + + register_platform_apis(); + register_module_types(); + GLOBAL_DEF("display/mouse_cursor/custom_image", String()); GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2()); GLOBAL_DEF("display/mouse_cursor/tooltip_position_offset", Point2(10, 10)); @@ -1758,18 +1773,6 @@ Error Main::setup2(Thread::ID p_main_tid_override) { Input::get_singleton()->set_custom_mouse_cursor(cursor, Input::CURSOR_ARROW, hotspot); } } -#ifdef TOOLS_ENABLED - ClassDB::set_current_api(ClassDB::API_EDITOR); - EditorNode::register_editor_types(); - - ClassDB::set_current_api(ClassDB::API_CORE); - -#endif - - MAIN_PRINT("Main: Load Modules, Physics, Drivers, Scripts"); - - register_platform_apis(); - register_module_types(); camera_server = CameraServer::create(); @@ -1992,7 +1995,7 @@ bool Main::start() { if (check_only) { if (!script_res->is_valid()) { - OS::get_singleton()->set_exit_code(1); + OS::get_singleton()->set_exit_code(EXIT_FAILURE); } return false; } |