summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index dbdfe481..3008e9cf 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -374,7 +374,9 @@ void Game::logic()
}
else
{
- while (abs(tick_time * 10 - drawTime) >= delta) {
+ if (abs(tick_time * 10 - drawTime) <= delta) {
+ SDL_Delay(10);
+ } else {
frame++;
engine->draw(graphics);
graphics->updateScreen();
@@ -385,6 +387,7 @@ void Game::logic()
else
{
SDL_Delay(10);
+ drawTime = tick_time * 10;
}
// Handle network stuff