summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-06-14 15:16:53 +0200
committerGitHub <noreply@github.com>2019-06-14 15:16:53 +0200
commit2f0f7db42b2f2011d6d8a759b89a1be5c795d264 (patch)
treec23e97864e7a7bda89130c8aa6210fe02282b067
parent146c1612ed8886c32fb9870a2b43f91003f207ce (diff)
parent2cce5699eaeb97db3a5fb82f31acd277443b6c08 (diff)
Merge pull request #29735 from sparkart/master
Limit Physics Process FPS above 0
-rw-r--r--core/engine.cpp1
-rw-r--r--main/main.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/core/engine.cpp b/core/engine.cpp
index 9607dedb3c..50822244cf 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -38,6 +38,7 @@
void Engine::set_iterations_per_second(int p_ips) {
+ ERR_FAIL_COND(p_ips <= 0);
ips = p_ips;
}
int Engine::get_iterations_per_second() const {
diff --git a/main/main.cpp b/main/main.cpp
index 3f01a17ea7..7e4fdeeaa7 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1020,6 +1020,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
Engine::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/common/physics_fps", 60));
+ ProjectSettings::get_singleton()->set_custom_property_info("physics/common/physics_fps", PropertyInfo(Variant::INT, "physics/common/physics_fps", PROPERTY_HINT_RANGE, "1,120,1,or_greater"));
Engine::get_singleton()->set_physics_jitter_fix(GLOBAL_DEF("physics/common/physics_jitter_fix", 0.5));
Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/settings/fps/force_fps", 0));
ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/fps/force_fps", PropertyInfo(Variant::INT, "debug/settings/fps/force_fps", PROPERTY_HINT_RANGE, "0,120,1,or_greater"));