From 076e2f4655c43e7dc79a01d576551942c7c3c057 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 24 Aug 2013 00:31:26 +0300 Subject: show/hide mouse cursor if mouse in/out window. --- src/game.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/game.cpp') 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) { -- cgit v1.2.3-60-g2f50