From b344f63a95e236ffd062608dd5a320a542946d75 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Wed, 3 May 2006 17:52:04 +0000 Subject: FPS limit can now be set in setup dialog. Default value for FPS is 50. (Code based on peoro's patch). --- src/game.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/game.cpp') 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) -- cgit v1.2.3-70-g09d2