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/config/engine.cpp | 8 ++++---- core/config/engine.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'core/config') diff --git a/core/config/engine.cpp b/core/config/engine.cpp index cf9697be07..21e910be5b 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -59,12 +59,12 @@ double Engine::get_physics_jitter_fix() const { return physics_jitter_fix; } -void Engine::set_target_fps(int p_fps) { - _target_fps = p_fps > 0 ? p_fps : 0; +void Engine::set_max_fps(int p_fps) { + _max_fps = p_fps > 0 ? p_fps : 0; } -int Engine::get_target_fps() const { - return _target_fps; +int Engine::get_max_fps() const { + return _max_fps; } uint64_t Engine::get_frames_drawn() { diff --git a/core/config/engine.h b/core/config/engine.h index 121fd4d541..21517e46b7 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -60,7 +60,7 @@ private: int ips = 60; double physics_jitter_fix = 0.5; double _fps = 1; - int _target_fps = 0; + int _max_fps = 0; double _time_scale = 1.0; uint64_t _physics_frames = 0; double _physics_interpolation_fraction = 0.0f; @@ -96,8 +96,8 @@ public: void set_physics_jitter_fix(double p_threshold); double get_physics_jitter_fix() const; - virtual void set_target_fps(int p_fps); - virtual int get_target_fps() const; + virtual void set_max_fps(int p_fps); + virtual int get_max_fps() const; virtual double get_frames_per_second() const { return _fps; } -- cgit v1.2.3