summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-24 00:31:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:17 +0300
commit076e2f4655c43e7dc79a01d576551942c7c3c057 (patch)
tree39bce5d299283f2bf00c24bff414331e714d8f21 /src/game.cpp
parentc88734cc2b8a0785c23531ce70bf703887aa0c4b (diff)
downloadplus-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.cpp11
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)
{