X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fapp%2Fstates.cpp;h=49ee8e23ac1793b88709cb6862fcb42d2d08a01c;hp=e45356b5a29f6779a878ca07a6d4c490d44c591f;hb=f5fc0c2bd1c0d1e2737d2b4ed49c3de16aa67c67;hpb=fbbee4cf7bd6f41139c2298c41d29b87401e6cf6 diff --git a/src/app/states.cpp b/src/app/states.cpp index e45356b..49ee8e2 100644 --- a/src/app/states.cpp +++ b/src/app/states.cpp @@ -50,8 +50,15 @@ void MasterState::OnResize(int w, int h) { void MasterState::OnUpdate(int dt) { remain += dt; - while (remain >= FrameMS()) { +#ifdef NDEBUG + int max_tick = 10; +#else + // one tick per frame when debugging so pausing execution doesn't result in more ticks + int max_tick = 1; +#endif + while (remain >= FrameMS() && max_tick > 0) { Tick(); + --max_tick; } }