1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Modified low processor sleep to 8000 and made it customizable (should be customizable for editor too)

This commit is contained in:
Juan Linietsky
2017-11-22 14:40:43 -03:00
parent 81213917d1
commit 62d86b1588
3 changed files with 18 additions and 1 deletions

View File

@@ -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)