diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/game.cpp | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2006-09-11 Eugenio Favalli <elvenprogrammer@gmail.com> + + * src/game.cpp: Fixed more fps issues. + 2006-09-09 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/gui.cpp: Removed easy targeting functionality since it 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 |