X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2Fstates.cpp;h=4951c9f220c5afe1308b13e504ed33d981d068e6;hb=392826deaf802ac0960ed3924a3f98b9d18d381b;hp=e45356b5a29f6779a878ca07a6d4c490d44c591f;hpb=475f28f06c9e14912bab8119264e247ef466513d;p=blobs.git diff --git a/src/app/states.cpp b/src/app/states.cpp index e45356b..4951c9f 100644 --- a/src/app/states.cpp +++ b/src/app/states.cpp @@ -24,6 +24,8 @@ MasterState::MasterState(Assets &assets, world::Simulation &sim) noexcept , cam_orient(PI * 0.375, PI * 0.25, 0.0) , cam_dragging(false) , cp(assets) +, rp(sim) +, tp(sim) , remain(0) , thirds(0) , paused(false) { @@ -50,8 +52,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; } } @@ -185,7 +194,9 @@ void MasterState::OnRender(graphics::Viewport &viewport) { } viewport.ClearDepth(); - cp.Draw(assets, viewport); + cp.Draw(viewport); + rp.Draw(viewport); + tp.Draw(viewport); } }