You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add game speed controls to the embedded game window
This commit is contained in:
@@ -4715,10 +4715,10 @@ bool Main::iteration() {
|
||||
|
||||
const uint64_t ticks_elapsed = ticks - last_ticks;
|
||||
|
||||
const int physics_ticks_per_second = Engine::get_singleton()->get_physics_ticks_per_second();
|
||||
const int physics_ticks_per_second = Engine::get_singleton()->get_user_physics_ticks_per_second();
|
||||
const double physics_step = 1.0 / physics_ticks_per_second;
|
||||
|
||||
const double time_scale = Engine::get_singleton()->get_time_scale();
|
||||
const double time_scale = Engine::get_singleton()->get_effective_time_scale();
|
||||
|
||||
MainFrameTime advance = main_timer_sync.advance(physics_step, physics_ticks_per_second);
|
||||
double process_step = advance.process_step;
|
||||
@@ -4737,7 +4737,7 @@ bool Main::iteration() {
|
||||
|
||||
last_ticks = ticks;
|
||||
|
||||
const int max_physics_steps = Engine::get_singleton()->get_max_physics_steps_per_frame();
|
||||
const int max_physics_steps = Engine::get_singleton()->get_user_max_physics_steps_per_frame();
|
||||
if (fixed_fps == -1 && advance.physics_steps > max_physics_steps) {
|
||||
process_step -= (advance.physics_steps - max_physics_steps) * physics_step;
|
||||
advance.physics_steps = max_physics_steps;
|
||||
|
||||
Reference in New Issue
Block a user