You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Merge pull request #48390 from lawnjelly/delta_smooth
Add frame delta smoothing option
This commit is contained in:
@@ -270,6 +270,8 @@ void Main::print_help(const char *p_binary) {
|
||||
OS::get_singleton()->print(" --no-window Run with invisible window. Useful together with --script.\n");
|
||||
OS::get_singleton()->print(" --enable-vsync-via-compositor When vsync is enabled, vsync via the OS' window compositor (Windows only).\n");
|
||||
OS::get_singleton()->print(" --disable-vsync-via-compositor Disable vsync via the OS' window compositor (Windows only).\n");
|
||||
OS::get_singleton()->print(" --enable-delta-smoothing When vsync is enabled, enabled frame delta smoothing.\n");
|
||||
OS::get_singleton()->print(" --disable-delta-smoothing Disable frame delta smoothing.\n");
|
||||
OS::get_singleton()->print(" --tablet-driver Tablet input driver (");
|
||||
for (int i = 0; i < OS::get_singleton()->get_tablet_driver_count(); i++) {
|
||||
if (i != 0) {
|
||||
@@ -420,6 +422,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
bool use_custom_res = true;
|
||||
bool force_res = false;
|
||||
bool saw_vsync_via_compositor_override = false;
|
||||
bool delta_smoothing_override = false;
|
||||
#ifdef TOOLS_ENABLED
|
||||
bool found_project = false;
|
||||
#endif
|
||||
@@ -640,6 +643,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
} else if (I->get() == "--disable-vsync-via-compositor") {
|
||||
video_mode.vsync_via_compositor = false;
|
||||
saw_vsync_via_compositor_override = true;
|
||||
} else if (I->get() == "--enable-delta-smoothing") {
|
||||
OS::get_singleton()->set_delta_smoothing(true);
|
||||
delta_smoothing_override = true;
|
||||
} else if (I->get() == "--disable-delta-smoothing") {
|
||||
OS::get_singleton()->set_delta_smoothing(false);
|
||||
delta_smoothing_override = true;
|
||||
#endif
|
||||
} else if (I->get() == "--profiling") { // enable profiling
|
||||
|
||||
@@ -1195,6 +1204,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 6900)); // Roughly 144 FPS
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("application/run/low_processor_mode_sleep_usec", PropertyInfo(Variant::INT, "application/run/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "0,33200,1,or_greater")); // No negative numbers
|
||||
|
||||
GLOBAL_DEF("application/run/delta_smoothing", true);
|
||||
if (!delta_smoothing_override) {
|
||||
OS::get_singleton()->set_delta_smoothing(GLOBAL_GET("application/run/delta_smoothing"));
|
||||
}
|
||||
|
||||
GLOBAL_DEF("display/window/ios/hide_home_indicator", true);
|
||||
GLOBAL_DEF("input_devices/pointing/ios/touch_delay", 0.150);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user