diff options
author | Reid <reidyaro@gmail.com> | 2012-01-25 22:05:36 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-01-25 22:05:36 +0100 |
commit | 8b612abb42853a22c1a9545e2c9280d154646543 (patch) | |
tree | f466167087c2b2de4b8aa9e6d1d1986f72f84147 /src/game.cpp | |
parent | a913dd41df61760de6ece552f941e002251ff54c (diff) | |
parent | d340b5a27a8f3b05d1764da9c114f5f59bd0cd46 (diff) | |
download | manaverse-8b612abb42853a22c1a9545e2c9280d154646543.tar.gz manaverse-8b612abb42853a22c1a9545e2c9280d154646543.tar.bz2 manaverse-8b612abb42853a22c1a9545e2c9280d154646543.tar.xz manaverse-8b612abb42853a22c1a9545e2c9280d154646543.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/game.cpp b/src/game.cpp index 9245e213d..aa9ba1536 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011 The ManaPlus Developers + * Copyright (C) 2011-2012 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -216,7 +216,9 @@ static void createGuiWindows() minimap = new Minimap; helpWindow = new HelpWindow; debugWindow = new DebugWindow; - itemShortcutWindow = new ShortcutWindow("ItemShortcut", "items.xml"); + itemShortcutWindow = new ShortcutWindow( + "ItemShortcut", "items.xml", 83, 460); + for (int f = 0; f < SHORTCUT_TABS; f ++) { itemShortcutWindow->addTab(toString(f + 1), @@ -488,7 +490,7 @@ static bool saveScreenshot() filenameSuffix.str(""); filename.str(""); filename << screenshotDirectory << "/"; - filenameSuffix << branding.getValue("appShort", "ManaPlus") + filenameSuffix << branding.getValue("appName", "ManaPlus") << "_Screenshot_" << screenshotCount << ".png"; filename << filenameSuffix.str(); testExists.open(filename.str().c_str(), std::ios::in); @@ -572,6 +574,7 @@ void Game::logic() } closeDialogs(); Client::setFramerate(config.getIntValue("fpslimit")); + mNextAdjustTime = cur_time + adjustDelay; if (Client::getState() != STATE_ERROR) errorMessage = ""; } @@ -603,7 +606,10 @@ void Game::adjustPerfomance() return; } - int maxFps = config.getIntValue("fpslimit"); + int maxFps = Client::getFramerate(); + if (maxFps != config.getIntValue("fpslimit")) + return; + if (!maxFps) maxFps = 30; else if (maxFps < 10) @@ -1579,7 +1585,6 @@ void Game::handleActive(SDL_Event &event) player_node->setHalfAway(true); } } - Client::setFramerate(fpsLimit); } if (player_node) player_node->updateName(); @@ -1589,19 +1594,22 @@ void Game::handleActive(SDL_Event &event) if (event.active.state & SDL_APPMOUSEFOCUS) Client::setMouseFocused(event.active.gain); - if (player_node && player_node->getAway()) + if (!fpsLimit) { - if (Client::getInputFocused() || Client::getMouseFocused()) - fpsLimit = config.getIntValue("fpslimit"); + if (player_node && player_node->getAway()) + { + if (Client::getInputFocused() || Client::getMouseFocused()) + fpsLimit = config.getIntValue("fpslimit"); + else + fpsLimit = config.getIntValue("altfpslimit"); + } else - fpsLimit = config.getIntValue("altfpslimit"); - Client::setFramerate(fpsLimit); - } - else - { - fpsLimit = config.getIntValue("fpslimit"); - Client::setFramerate(fpsLimit); + { + fpsLimit = config.getIntValue("fpslimit"); + } } + Client::setFramerate(fpsLimit); + mNextAdjustTime = cur_time + adjustDelay; } /** |