X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FApplication.cpp;h=fc1d3801d4ab6fe65f0ea8af622904e0eb01b194;hb=bce16ed519add0d5398d504d2554395c43c74571;hp=29eaee781e9ba20780fafa2cc4bde331777d059a;hpb=62c0a1d0ac98eb51418e4daa59e80b6cc97b522f;p=l2e.git diff --git a/src/app/Application.cpp b/src/app/Application.cpp index 29eaee7..fc1d380 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -120,8 +120,12 @@ void Application::Run() { void Application::Loop() { Uint32 now(SDL_GetTicks()); Uint32 deltaT(now - last); + GlobalTimers().Update(deltaT); if (deltaT > 34) deltaT = 34; + if (CurrentState()) { + CurrentState()->GraphicsTimers().Update(deltaT); + } HandleEvents(); if (!StateChangePending()) { UpdateWorld(deltaT); @@ -161,6 +165,7 @@ void Application::HandleEvents() { void Application::UpdateWorld(Uint32 deltaT) { if (!CurrentState()) return; for (Uint32 i(0); i < deltaT; ++i) { + CurrentState()->PhysicsTimers().Update(0.001f); CurrentState()->UpdateWorld(0.001f); } }