1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +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:
Ricardo Buring
2024-07-07 17:34:50 +02:00
parent f3af22b10b
commit 23521635d2
7 changed files with 5 additions and 14 deletions

View File

@@ -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;
}