mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #107273 from DexterFstone/add-game-speed-controls
Add game speed controls to the embedded game window
This commit is contained in:
commit
3b04c8464c
10 changed files with 173 additions and 11 deletions
|
|
@ -4604,10 +4604,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;
|
||||
|
|
@ -4626,7 +4626,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue