From 1c6c72caf1b3cc004c3bcbe65b5bef5c850f82f8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 22 Sep 2022 22:15:07 +0200 Subject: Rename `Engine.target_fps` and associated project setting to `max_fps` This makes the setting easier to find, as research has found there are numerous use cases to limiting FPS. This also improves documentation related to the Engine property and project setting. The project setting also works in projects exported in release mode, so its location in the `debug/` section was misleading. --- core/os/os.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/os') diff --git a/core/os/os.cpp b/core/os/os.cpp index 2bdede889f..72d68893f3 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -511,10 +511,10 @@ void OS::add_frame_delay(bool p_can_draw) { if (is_in_low_processor_usage_mode() || !p_can_draw) { dynamic_delay = get_low_processor_usage_mode_sleep_usec(); } - const int target_fps = Engine::get_singleton()->get_target_fps(); - if (target_fps > 0 && !Engine::get_singleton()->is_editor_hint()) { + const int max_fps = Engine::get_singleton()->get_max_fps(); + if (max_fps > 0 && !Engine::get_singleton()->is_editor_hint()) { // Override the low processor usage mode sleep delay if the target FPS is lower. - dynamic_delay = MAX(dynamic_delay, (uint64_t)(1000000 / target_fps)); + dynamic_delay = MAX(dynamic_delay, (uint64_t)(1000000 / max_fps)); } if (dynamic_delay > 0) { -- cgit v1.2.3