summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-09-06 14:17:48 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-09-06 14:17:48 +0000
commit21e6ad204f0201412bf7ee4efb3e9966e2fcda83 (patch)
tree83ad4c589b44e9ab1a4632c7f20d1a2553ca4f8b /src
parente8518f3a8e97990670abaceb8fd3c985e73f304e (diff)
downloadmana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.gz
mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.bz2
mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.tar.xz
mana-21e6ad204f0201412bf7ee4efb3e9966e2fcda83.zip
Fixed fps limiter when disabled
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp13
1 files changed, 11 insertions, 2 deletions
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