diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-22 14:40:43 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-11-22 14:41:45 -0300 |
commit | 62d86b15887371c59f99bfa37dbe2fcaf80478f7 (patch) | |
tree | f79db46d86b749cbe64f00a5ae949a583dd07e2f /main | |
parent | 81213917d11f9e177db0f0363ee42ff5a47a21dc (diff) |
Modified low processor sleep to 8000 and made it customizable (should be customizable for editor too)
Diffstat (limited to 'main')
-rwxr-xr-x | main/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 8b866e160f..cc20e65025 100755 --- a/main/main.cpp +++ b/main/main.cpp @@ -910,6 +910,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph frame_delay = GLOBAL_DEF("application/run/frame_delay_msec", 0); } + OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false)); + OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 8000)); + Engine::get_singleton()->set_frame_delay(frame_delay); message_queue = memnew(MessageQueue); @@ -1773,7 +1776,7 @@ bool Main::iteration() { return exit; if (OS::get_singleton()->is_in_low_processor_usage_mode() || !OS::get_singleton()->can_draw()) - OS::get_singleton()->delay_usec(16600); //apply some delay to force idle time (results in about 60 FPS max) + OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time (results in about 60 FPS max) else { uint32_t frame_delay = Engine::get_singleton()->get_frame_delay(); if (frame_delay) |