summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 190cdf3151..7ba5ffab2a 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1385,7 +1385,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
if (editor) {
packed_data->set_disabled(true);
- globals->set_disable_feature_overrides(true);
Engine::get_singleton()->set_editor_hint(true);
main_args.push_back("--editor");
if (!init_windowed) {
@@ -1920,6 +1919,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 +2087,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 +2122,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"));
@@ -2964,6 +2968,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
@@ -2992,6 +2997,7 @@ bool Main::iteration() {
uint64_t physics_process_ticks = 0;
uint64_t process_ticks = 0;
+ uint64_t navigation_process_ticks = 0;
frame += ticks_elapsed;
@@ -3028,8 +3034,13 @@ bool Main::iteration() {
break;
}
+ 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();
PhysicsServer3D::get_singleton()->end_sync();
@@ -3108,8 +3119,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;