diff options
author | Ricardo Buring <ricardo.buring@gmail.com> | 2024-07-07 17:34:50 +0200 |
---|---|---|
committer | Ricardo Buring <ricardo.buring@gmail.com> | 2024-07-07 19:04:05 +0200 |
commit | 23521635d2f68525a6e41dde17bf34a53225e3e1 (patch) | |
tree | 72d32495dca8256860589e6b2a7a3eeb6ea59a70 /main | |
parent | f3af22b10b1e64146d48be7726f6395c9a4185e9 (diff) | |
download | redot-engine-23521635d2f68525a6e41dde17bf34a53225e3e1.tar.gz |
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>
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index e6be23034d..060b3fe2f6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -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; } |