diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-09-06 14:17:48 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-09-06 14:17:48 +0000 |
commit | 21e6ad204f0201412bf7ee4efb3e9966e2fcda83 (patch) | |
tree | 83ad4c589b44e9ab1a4632c7f20d1a2553ca4f8b | |
parent | e8518f3a8e97990670abaceb8fd3c985e73f304e (diff) | |
download | mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.gz mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.bz2 mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.xz mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.zip |
Fixed fps limiter when disabled
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/game.cpp | 13 |
2 files changed, 12 insertions, 2 deletions
@@ -4,6 +4,7 @@ Added new market stand. * src/game.cpp, src/gui/setup_video.cpp, src/main.cpp: Fixed fps limiter issues and increased default limit to 60. + * src/game.cpp: Fixed fps limiter when disabled. 2006-09-05 Philipp Sehmisch <tmw@crushnet.org> 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 |