diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-13 11:36:36 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-13 11:36:36 +0000 |
commit | afc770043be553998555e9ac1cffca68dc482d48 (patch) | |
tree | 60e99ade9464b0a1de2ec246724a7bfe0957eec4 /src/game.cpp | |
parent | cfcc1bc3a756185bd39dd858ebbe69b5916ac11b (diff) | |
download | mana-afc770043be553998555e9ac1cffca68dc482d48.tar.gz mana-afc770043be553998555e9ac1cffca68dc482d48.tar.bz2 mana-afc770043be553998555e9ac1cffca68dc482d48.tar.xz mana-afc770043be553998555e9ac1cffca68dc482d48.zip |
Merged cleanups and content changes from the trunk. Also fixed compiling with
OpenGL enabled.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/game.cpp b/src/game.cpp index fab88aa9..eada1128 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -167,8 +167,7 @@ int get_elapsed_time(int start_time) void createGuiWindows(Network *network) { // Create dialogs - chatWindow = new ChatWindow( - config.getValue("homeDir", "") + std::string("/chatlog.txt"), network); + chatWindow = new ChatWindow(network); menuWindow = new MenuWindow(); statusWindow = new StatusWindow(player_node); miniStatusWindow = new MiniStatusWindow(); @@ -359,29 +358,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 { |