From 54542ef3ec98bfcef369e50d64d1af848c16bbf8 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 26 May 2022 14:51:42 +0200 Subject: Change Server initialization order * Registration of server classes happened after Display initialization. * This made no sense in practice and avoided the registration of custom server drivers (like custom XR server, custom Rendering server, custom XR server). * Initialization moved to _before_ Display. --- main/main.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index fff78d9e8f..20270190b3 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -411,8 +411,6 @@ Error Main::test_setup() { initialize_modules(MODULE_INITIALIZATION_LEVEL_CORE); register_core_extensions(); - preregister_server_types(); - register_core_singletons(); /** INITIALIZE SERVERS **/ @@ -1598,7 +1596,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { tsman->add_interface(ts); } - preregister_server_types(); + register_server_types(); + initialize_modules(MODULE_INITIALIZATION_LEVEL_SERVERS); + NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_SERVERS); // Print engine name and version print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); @@ -1763,10 +1763,6 @@ Error Main::setup2(Thread::ID p_main_tid_override) { DisplayServer::get_singleton()->enable_for_stealing_focus(allow_focus_steal_pid); } - register_server_types(); - initialize_modules(MODULE_INITIALIZATION_LEVEL_SERVERS); - NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_SERVERS); - MAIN_PRINT("Main: Load Boot Image"); Color clear = GLOBAL_DEF("rendering/environment/defaults/default_clear_color", Color(0.3, 0.3, 0.3)); -- cgit v1.2.3