]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Application.cpp
added escape title frame, text, and font
[l2e.git] / src / app / Application.cpp
index 29eaee781e9ba20780fafa2cc4bde331777d059a..819882e7251f43e66b7ed77311f97c498e74d456 100644 (file)
@@ -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);
@@ -155,12 +159,13 @@ void Application::HandleEvents() {
                                break;
                }
        }
-       CurrentState()->HandleInput(input);
+       CurrentState()->HandleEvents(input);
 }
 
 void Application::UpdateWorld(Uint32 deltaT) {
        if (!CurrentState()) return;
        for (Uint32 i(0); i < deltaT; ++i) {
+               CurrentState()->PhysicsTimers().Update(0.001f);
                CurrentState()->UpdateWorld(0.001f);
        }
 }