You've already forked godot
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user