diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-24 00:31:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-24 21:08:17 +0300 |
commit | 076e2f4655c43e7dc79a01d576551942c7c3c057 (patch) | |
tree | 39bce5d299283f2bf00c24bff414331e714d8f21 /src/game.cpp | |
parent | c88734cc2b8a0785c23531ce70bf703887aa0c4b (diff) | |
download | plus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.gz plus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.bz2 plus-076e2f4655c43e7dc79a01d576551942c7c3c057.tar.xz plus-076e2f4655c43e7dc79a01d576551942c7c3c057.zip |
show/hide mouse cursor if mouse in/out window.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp index d15c79a36..41a036c0f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -876,18 +876,13 @@ void Game::moveInDirection(const unsigned char direction) void Game::handleActive(const SDL_Event &event) { -// logger->log("SDL_ACTIVEEVENT"); -// logger->log("state: %d", (int)event.active.state); -// logger->log("gain: %d", (int)event.active.gain); - - // +++ need use window events #ifndef USE_SDL2 int fpsLimit = 0; if (event.active.state & SDL_APPACTIVE) { if (event.active.gain) { // window restore - Client::setIsMinimized(false); + client->setIsMinimized(false); if (player_node) { if (!player_node->getAway()) @@ -901,7 +896,7 @@ void Game::handleActive(const SDL_Event &event) #ifdef ANDROID client->setState(STATE_EXIT); #else - Client::setIsMinimized(true); + client->setIsMinimized(true); if (player_node && !player_node->getAway()) { fpsLimit = config.getIntValue("altfpslimit"); @@ -919,7 +914,7 @@ void Game::handleActive(const SDL_Event &event) if (event.active.state & SDL_APPINPUTFOCUS) client->setInputFocused(event.active.gain); if (event.active.state & SDL_APPMOUSEFOCUS) - Client::setMouseFocused(event.active.gain); + client->setMouseFocused(event.active.gain); if (!fpsLimit) { |