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 | |
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')
-rw-r--r-- | src/game.cpp | 16 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 2 |
3 files changed, 10 insertions, 10 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 { diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 2c9bc4a2..7abcde53 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -105,7 +105,7 @@ Setup_Video::Setup_Video(): mOpenGLEnabled(config.getValue("opengl", 0)), mCustomCursorEnabled(config.getValue("customcursor", 1)), mOpacity(config.getValue("guialpha", 0.8)), - mFps((int)config.getValue("fpslimit", 50)), + mFps((int)config.getValue("fpslimit", 60)), mModeListModel(new ModeListModel()), mModeList(new ListBox(mModeListModel)), mFsCheckBox(new CheckBox("Full screen", mFullScreenEnabled)), diff --git a/src/main.cpp b/src/main.cpp index bc6cedc4..17d00949 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -207,7 +207,7 @@ void init_engine(const Options &options) config.setValue("remember", 1); config.setValue("sfxVolume", 100); config.setValue("musicVolume", 60); - config.setValue("fpslimit", 50); + config.setValue("fpslimit", 60); config.setValue("updatehost", "http://themanaworld.org/files"); config.setValue("customcursor", 1); config.setValue("homeDir", homeDir); |