Merge pull request #18368 from Gamblify/RasterizerEngineSync
sync rasterizers with engine
This commit is contained in:
commit
237148e80f
17 changed files with 33 additions and 58 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue