Browse Source

Don't apply frame delay project setting to the editor

This appears to already be the case for the Max FPS project setting.

(cherry picked from commit a63556212d808711ce9db460e0aab33f427cd835)
Hugo Locurcio 1 năm trước cách đây
mục cha
commit
b468496700
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 2 1
      doc/classes/ProjectSettings.xml
  2. 3 0
      main/main.cpp

+ 2 - 1
doc/classes/ProjectSettings.xml

@@ -324,7 +324,8 @@
 			Changes to this setting will only be applied upon restarting the application.
 			Changes to this setting will only be applied upon restarting the application.
 		</member>
 		</member>
 		<member name="application/run/frame_delay_msec" type="int" setter="" getter="" default="0">
 		<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>
 		<member name="application/run/low_processor_mode" type="bool" setter="" getter="" default="false">
 		<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.
 			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.

+ 3 - 0
main/main.cpp

@@ -1962,6 +1962,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
 
 
 	if (frame_delay == 0) {
 	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);
 		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;
+		}
 	}
 	}
 
 
 	OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false));
 	OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false));