diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-03 17:52:04 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-05-03 17:52:04 +0000 |
commit | b344f63a95e236ffd062608dd5a320a542946d75 (patch) | |
tree | bfd3b1827795f694fb9e9438eb74715bd448b6cc /src/game.cpp | |
parent | c74ed8da3751f85b4bfb235b055f404f5340eae7 (diff) | |
download | mana-b344f63a95e236ffd062608dd5a320a542946d75.tar.gz mana-b344f63a95e236ffd062608dd5a320a542946d75.tar.bz2 mana-b344f63a95e236ffd062608dd5a320a542946d75.tar.xz mana-b344f63a95e236ffd062608dd5a320a542946d75.zip |
FPS limit can now be set in setup dialog. Default value for FPS is 50. (Code based on peoro's patch).
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index a03989fe..0ccc7542 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -344,11 +344,7 @@ void Game::logic() int gameTime = tick_time; int drawTime = tick_time * 10; int delta = 0; - int fpsLimit = (int)config.getValue("fpslimit", 0); - if (fpsLimit) - { - delta = 1000 / fpsLimit; - } + int fpsLimit = 0; while (!done) { @@ -361,6 +357,16 @@ void Game::logic() } gameTime = tick_time; + + fpsLimit = (int)config.getValue("fpslimit", 50); + if (fpsLimit) + { + delta = 1000 / fpsLimit; + } + else + { + delta = 0; + } // Update the screen when application is active, delay otherwise if (SDL_GetAppState() & SDL_APPACTIVE) |