diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/main/main.cpp b/main/main.cpp index 4cab469672..6b04cdc6d6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1920,6 +1920,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { window_position = &position; } + Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color); + DisplayServer::set_early_window_clear_color_override(true, boot_bg_color); + // rendering_driver now held in static global String in main and initialized in setup() Error err; display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, err); @@ -2085,7 +2088,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0)); } - Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color); + Color boot_bg_color = GLOBAL_GET("application/boot_splash/bg_color"); #if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH) boot_bg_color = @@ -2120,6 +2123,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) { #endif } + DisplayServer::set_early_window_clear_color_override(false); + MAIN_PRINT("Main: DCC"); RenderingServer::get_singleton()->set_default_clear_color( GLOBAL_GET("rendering/environment/defaults/default_clear_color")); @@ -2607,7 +2612,7 @@ bool Main::start() { if (debug_navigation) { sml->set_debug_navigation_hint(true); NavigationServer3D::get_singleton()->set_active(true); - NavigationServer3D::get_singleton_mut()->set_debug_enabled(true); + NavigationServer3D::get_singleton()->set_debug_enabled(true); } #endif @@ -2769,10 +2774,6 @@ bool Main::start() { DisplayServer::get_singleton()->window_set_title(appname); #endif - // Define a very small minimum window size to prevent bugs such as GH-37242. - // It can still be overridden by the user in a script. - DisplayServer::get_singleton()->window_set_min_size(Size2i(64, 64)); - bool snap_controls = GLOBAL_GET("gui/common/snap_controls_to_pixels"); sml->get_root()->set_snap_controls_to_pixels(snap_controls); @@ -2968,6 +2969,7 @@ bool Main::is_iterating() { // For performance metrics. static uint64_t physics_process_max = 0; static uint64_t process_max = 0; +static uint64_t navigation_process_max = 0; bool Main::iteration() { //for now do not error on this @@ -2996,6 +2998,7 @@ bool Main::iteration() { uint64_t physics_process_ticks = 0; uint64_t process_ticks = 0; + uint64_t navigation_process_ticks = 0; frame += ticks_elapsed; @@ -3032,7 +3035,13 @@ bool Main::iteration() { break; } - NavigationServer3D::get_singleton_mut()->process(physics_step * time_scale); + NavigationServer3D::get_singleton()->process(physics_step * time_scale); + uint64_t navigation_begin = OS::get_singleton()->get_ticks_usec(); + + NavigationServer3D::get_singleton()->process(physics_step * time_scale); + + navigation_process_ticks = MAX(navigation_process_ticks, OS::get_singleton()->get_ticks_usec() - navigation_begin); // keep the largest one for reference + navigation_process_max = MAX(OS::get_singleton()->get_ticks_usec() - navigation_begin, navigation_process_max); message_queue->flush(); @@ -3112,8 +3121,10 @@ bool Main::iteration() { Engine::get_singleton()->_fps = frames; performance->set_process_time(USEC_TO_SEC(process_max)); performance->set_physics_process_time(USEC_TO_SEC(physics_process_max)); + performance->set_navigation_process_time(USEC_TO_SEC(navigation_process_max)); process_max = 0; physics_process_max = 0; + navigation_process_max = 0; frame %= 1000000; frames = 0; |