diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-09-04 18:07:16 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-09-04 18:07:16 +0200 |
commit | 4328ffcc796ef916056b7c677761f6b979fad59a (patch) | |
tree | 0e86e753a845e2cc8fe0621257e4c12e640d70f5 /main/main.cpp | |
parent | 75de1ca76871fdf7f5a9e081aa57ec0e33061107 (diff) | |
download | redot-engine-4328ffcc796ef916056b7c677761f6b979fad59a.tar.gz |
Fix ThemeDB initialization in tests
Also fixes class name shadowing in Viewport/Window tests.
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/main/main.cpp b/main/main.cpp index 0a9ebd4c61..7efd503f95 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -570,9 +570,15 @@ Error Main::test_setup() { ResourceLoader::load_path_remaps(); + // Initialize ThemeDB early so that scene types can register their theme items. + // Default theme will be initialized later, after modules and ScriptServer are ready. + initialize_theme_db(); + register_scene_types(); register_driver_types(); + register_scene_singletons(); + initialize_modules(MODULE_INITIALIZATION_LEVEL_SCENE); GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SCENE); @@ -588,9 +594,7 @@ Error Main::test_setup() { register_platform_apis(); // Theme needs modules to be initialized so that sub-resources can be loaded. - initialize_theme_db(); - theme_db->initialize_theme(); - register_scene_singletons(); + theme_db->initialize_theme_noproject(); initialize_navigation_server(); @@ -2561,9 +2565,15 @@ Error Main::setup2() { OS::get_singleton()->benchmark_begin_measure("scene"); + // Initialize ThemeDB early so that scene types can register their theme items. + // Default theme will be initialized later, after modules and ScriptServer are ready. + initialize_theme_db(); + register_scene_types(); register_driver_types(); + register_scene_singletons(); + initialize_modules(MODULE_INITIALIZATION_LEVEL_SCENE); GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SCENE); @@ -2581,11 +2591,6 @@ Error Main::setup2() { register_platform_apis(); - // Theme needs modules to be initialized so that sub-resources can be loaded. - // Default theme is initialized later, after ScriptServer is ready. - initialize_theme_db(); - register_scene_singletons(); - GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp"), String()); GLOBAL_DEF_BASIC("display/mouse_cursor/custom_image_hotspot", Vector2()); GLOBAL_DEF_BASIC("display/mouse_cursor/tooltip_position_offset", Point2(10, 10)); |