diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-23 22:00:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:16 +0300 |
commit | c2a7004213529c403faeb6fdcc374699aa2f53b5 (patch) | |
tree | f5701ef3412923bc0e5e033033bd52960d66acc3 /src/game.cpp | |
parent | e8a4474319aca4a32869fa1ebb8b5ebbd98237f6 (diff) | |
download | manaplus-c2a7004213529c403faeb6fdcc374699aa2f53b5.tar.gz manaplus-c2a7004213529c403faeb6fdcc374699aa2f53b5.tar.bz2 manaplus-c2a7004213529c403faeb6fdcc374699aa2f53b5.tar.xz manaplus-c2a7004213529c403faeb6fdcc374699aa2f53b5.zip |
improve getState/setState in Client.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game.cpp b/src/game.cpp index 80408f836..884034179 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -455,7 +455,7 @@ Game::~Game() AnimatedSprite::setEnableCache(false); del_0(actorSpriteManager) - if (Client::getState() != STATE_CHANGE_MAP) + if (client->getState() != STATE_CHANGE_MAP) del_0(player_node) del_0(commandHandler) del_0(effectManager) @@ -611,10 +611,10 @@ void Game::slowLogic() // Handle network stuff if (!Net::getGameHandler()->isConnected()) { - if (Client::getState() == STATE_CHANGE_MAP) + if (client->getState() == STATE_CHANGE_MAP) return; // Not a problem here - if (Client::getState() != STATE_ERROR) + if (client->getState() != STATE_ERROR) { if (!disconnectedDialog) { @@ -633,14 +633,14 @@ void Game::slowLogic() const Map *const map = viewport->getCurrentMap(); if (map) { - logger->log("state: %d", Client::getState()); + logger->log("state: %d", client->getState()); map->saveExtraLayer(); } } closeDialogs(); Client::setFramerate(config.getIntValue("fpslimit")); mNextAdjustTime = cur_time + adjustDelay; - if (Client::getState() != STATE_ERROR) + if (client->getState() != STATE_ERROR) errorMessage.clear(); } else @@ -899,7 +899,7 @@ void Game::handleActive(const SDL_Event &event) else { // window minimization #ifdef ANDROID - Client::setState(STATE_EXIT); + client->setState(STATE_EXIT); #else Client::setIsMinimized(true); if (player_node && !player_node->getAway()) @@ -988,7 +988,7 @@ void Game::handleInput() #endif // Quit event case SDL_QUIT: - Client::setState(STATE_EXIT); + client->setState(STATE_EXIT); break; #ifdef ANDROID case SDL_KEYBOARDSHOW: |