summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-11-12 12:14:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-11-12 12:14:18 +0100
commit10e820a783e4e8d379e8f55a54c1dc0bc3c5a203 (patch)
tree33ebe4c0696144a79da118d940fd281b0d2cb7b1
parent8928b2044b76fb3160c5c17a48a93331233f01f9 (diff)
parenta63556212d808711ce9db460e0aab33f427cd835 (diff)
downloadredot-engine-10e820a783e4e8d379e8f55a54c1dc0bc3c5a203.tar.gz
Merge pull request #82929 from Calinou/projectsettings-frame-delay-no-editor
Don't apply frame delay project setting to the editor
-rw-r--r--doc/classes/ProjectSettings.xml3
-rw-r--r--main/main.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 93e0ed5491..3fc9e94427 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -328,7 +328,8 @@
Changes to this setting will only be applied upon restarting the application.
</member>
<member name="application/run/frame_delay_msec" type="int" setter="" getter="" default="0">
- Forces a delay between frames in the main loop (in milliseconds). This may be useful if you plan to disable vertical synchronization.
+ Forces a [i]constant[/i] delay between frames in the main loop (in milliseconds). In most situations, [member application/run/max_fps] should be preferred as an FPS limiter as it's more precise.
+ This setting can be overridden using the [code]--frame-delay &lt;ms;&gt;[/code] command line argument.
</member>
<member name="application/run/low_processor_mode" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables low-processor usage mode. This setting only works on desktop platforms. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games.
diff --git a/main/main.cpp b/main/main.cpp
index 7ca22d90ca..271791f368 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2128,6 +2128,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (frame_delay == 0) {
frame_delay = GLOBAL_DEF(PropertyInfo(Variant::INT, "application/run/frame_delay_msec", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), 0);
+ if (Engine::get_singleton()->is_editor_hint()) {
+ frame_delay = 0;
+ }
}
if (audio_output_latency >= 1) {