diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-09-06 11:46:26 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-09-06 11:46:26 +0000 |
commit | e8518f3a8e97990670abaceb8fd3c985e73f304e (patch) | |
tree | bc2d312612ab87e09e4003e002f09f4d6080868f /src/game.cpp | |
parent | 2dfa80675eba4c1bea635b7a72bebc4dd922e66e (diff) | |
download | mana-client-e8518f3a8e97990670abaceb8fd3c985e73f304e.tar.gz mana-client-e8518f3a8e97990670abaceb8fd3c985e73f304e.tar.bz2 mana-client-e8518f3a8e97990670abaceb8fd3c985e73f304e.tar.xz mana-client-e8518f3a8e97990670abaceb8fd3c985e73f304e.zip |
Fixed fps limiter issues and increased default limit to 60
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp index 7921c388..630e40e5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -361,17 +361,17 @@ void Game::logic() gameTime = tick_time; - fpsLimit = (int)config.getValue("fpslimit", 50); + fpsLimit = (int)config.getValue("fpslimit", 60); delta = fpsLimit ? 1000 / fpsLimit : 0; // Update the screen when application is active, delay otherwise - if (SDL_GetAppState() & SDL_APPACTIVE && - (abs(tick_time * 10 - drawTime) >= delta)) - { - frame++; - engine->draw(graphics); - graphics->updateScreen(); - drawTime += delta; + if (SDL_GetAppState() & SDL_APPACTIVE) { + while (abs(tick_time * 10 - drawTime) >= delta) { + frame++; + engine->draw(graphics); + graphics->updateScreen(); + drawTime += delta; + } } else { |