mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix physics tick counter
The counter is now incremented at the start of a physics tick rather than at the end. Co-authored-by: lawnjelly <lawnjelly@gmail.com>
This commit is contained in:
parent
f3af22b10b
commit
23521635d2
7 changed files with 5 additions and 14 deletions
|
|
@ -4043,6 +4043,7 @@ bool Main::iteration() {
|
|||
}
|
||||
|
||||
Engine::get_singleton()->_in_physics = true;
|
||||
Engine::get_singleton()->_physics_frames++;
|
||||
|
||||
uint64_t physics_begin = OS::get_singleton()->get_ticks_usec();
|
||||
|
||||
|
|
@ -4090,7 +4091,6 @@ bool Main::iteration() {
|
|||
|
||||
physics_process_ticks = MAX(physics_process_ticks, OS::get_singleton()->get_ticks_usec() - physics_begin); // keep the largest one for reference
|
||||
physics_process_max = MAX(OS::get_singleton()->get_ticks_usec() - physics_begin, physics_process_max);
|
||||
Engine::get_singleton()->_physics_frames++;
|
||||
|
||||
Engine::get_singleton()->_in_physics = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue