From 21e6ad204f0201412bf7ee4efb3e9966e2fcda83 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Wed, 6 Sep 2006 14:17:48 +0000 Subject: Fixed fps limiter when disabled --- src/game.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 630e40e5..dbdfe481 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -366,11 +366,20 @@ void Game::logic() // Update the screen when application is active, delay otherwise if (SDL_GetAppState() & SDL_APPACTIVE) { - while (abs(tick_time * 10 - drawTime) >= delta) { + if (fpsLimit == 0) { frame++; engine->draw(graphics); graphics->updateScreen(); - drawTime += delta; + drawTime = tick_time * 10; + } + else + { + while (abs(tick_time * 10 - drawTime) >= delta) { + frame++; + engine->draw(graphics); + graphics->updateScreen(); + drawTime += delta; + } } } else -- cgit v1.2.3-70-g09d2