diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index cbf30af38c..b94130002d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1789,6 +1789,10 @@ uint64_t Main::target_ticks = 0; uint32_t Main::frames = 0; uint32_t Main::frame = 0; bool Main::force_redraw_requested = false; +bool Main::iterating = false; +bool Main::is_iterating() { + return iterating; +} // For performance metrics static uint64_t physics_process_max = 0; @@ -1796,6 +1800,10 @@ static uint64_t idle_process_max = 0; bool Main::iteration() { + ERR_FAIL_COND_V(iterating, false); + + iterating = true; + uint64_t ticks = OS::get_singleton()->get_ticks_usec(); Engine::get_singleton()->_frame_ticks = ticks; main_timer_sync.set_cpu_ticks_usec(ticks); @@ -1923,6 +1931,8 @@ bool Main::iteration() { frames = 0; } + iterating = false; + if (fixed_fps != -1) return exit; |