summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 56dd5f73e7..5beeb95a11 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1734,8 +1734,11 @@ bool Main::iteration() {
int physics_fps = Engine::get_singleton()->get_iterations_per_second();
float frame_slice = 1.0 / physics_fps;
+ float time_scale = Engine::get_singleton()->get_time_scale();
+
MainFrameTime advance = main_timer_sync.advance(frame_slice, physics_fps);
double step = advance.idle_step;
+ double scaled_step = step * time_scale;
Engine::get_singleton()->_frame_step = step;
@@ -1757,8 +1760,6 @@ bool Main::iteration() {
advance.physics_steps = max_physics_steps;
}
- float time_scale = Engine::get_singleton()->get_time_scale();
-
bool exit = false;
Engine::get_singleton()->_in_physics = true;
@@ -1805,11 +1806,11 @@ bool Main::iteration() {
if ((!force_redraw_requested) && OS::get_singleton()->is_in_low_processor_usage_mode()) {
if (VisualServer::get_singleton()->has_changed()) {
- VisualServer::get_singleton()->draw(); // flush visual commands
+ VisualServer::get_singleton()->draw(true, scaled_step); // flush visual commands
Engine::get_singleton()->frames_drawn++;
}
} else {
- VisualServer::get_singleton()->draw(); // flush visual commands
+ VisualServer::get_singleton()->draw(true, scaled_step); // flush visual commands
Engine::get_singleton()->frames_drawn++;
force_redraw_requested = false;
}