summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-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