diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-08-05 02:20:34 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-08-05 02:20:34 +0000 |
commit | d25e1c9b0dac7fcfe803083af1189489d5a9ad88 (patch) | |
tree | 330e30558d62c4de99976305390a976fd5f8d958 /src/game.cpp | |
parent | 97f1e5345cc8a88fed9c65035f2b01fc2eaf9cbd (diff) | |
download | mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.gz mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.bz2 mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.tar.xz mana-d25e1c9b0dac7fcfe803083af1189489d5a9ad88.zip |
Some cleanups, mostly lowering indentation levels.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/game.cpp b/src/game.cpp index 51b541a6..0d834468 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -359,29 +359,16 @@ void Game::logic() gameTime = tick_time; fpsLimit = (int)config.getValue("fpslimit", 50); - if (fpsLimit) - { - delta = 1000 / fpsLimit; - } - else - { - delta = 0; - } + delta = fpsLimit ? 1000 / fpsLimit : 0; // Update the screen when application is active, delay otherwise - if (SDL_GetAppState() & SDL_APPACTIVE) + if (SDL_GetAppState() & SDL_APPACTIVE && + (abs(tick_time * 10 - drawTime) >= delta)) { - if (abs(tick_time * 10 - drawTime) >= delta) - { - frame++; - engine->draw(graphics); - graphics->updateScreen(); - drawTime += delta; - } - else - { - SDL_Delay(10); - } + frame++; + engine->draw(graphics); + graphics->updateScreen(); + drawTime += delta; } else { |