diff options
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/src/game.cpp b/src/game.cpp index 971352234..1e8d19398 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -877,109 +877,6 @@ void Game::moveInDirection(const unsigned char direction) } } -#ifdef USE_SDL2 -void Game::handleSDL2WindowEvent(const SDL_Event &event) -{ - int fpsLimit = 0; - const int eventType = event.window.event; - switch (eventType) - { - case SDL_WINDOWEVENT_RESIZED: - client->resizeVideo(event.window.data1, event.window.data2, false); - break; - case SDL_WINDOWEVENT_ENTER: - client->setMouseFocused(true); - break; - case SDL_WINDOWEVENT_LEAVE: - client->setMouseFocused(false); - break; - case SDL_WINDOWEVENT_FOCUS_GAINED: - client->setInputFocused(true); - break; - case SDL_WINDOWEVENT_FOCUS_LOST: - client->setInputFocused(false); - break; - case SDL_WINDOWEVENT_MINIMIZED: - client->setIsMinimized(true); - if (player_node && !player_node->getAway()) - { - fpsLimit = config.getIntValue("altfpslimit"); - player_node->setHalfAway(true); - } - setPriority(false); - break; - case SDL_WINDOWEVENT_RESTORED: - case SDL_WINDOWEVENT_MAXIMIZED: - client->setIsMinimized(false); - if (player_node) - { - if (!player_node->getAway()) - fpsLimit = config.getIntValue("fpslimit"); - player_node->setHalfAway(false); - } - setPriority(true); - break; - default: - break; - } - - if (eventType == SDL_WINDOWEVENT_MINIMIZED - || eventType == SDL_WINDOWEVENT_RESTORED - || eventType == SDL_WINDOWEVENT_MAXIMIZED) - { - if (player_node) - { - player_node->updateStatus(); - player_node->updateName(); - } - updateFrameRate(fpsLimit); - } -} -#else -void Game::handleActive(const SDL_Event &event) -{ - int fpsLimit = 0; - if (event.active.state & SDL_APPACTIVE) - { - if (event.active.gain) - { // window restore - client->setIsMinimized(false); - if (player_node) - { - if (!player_node->getAway()) - fpsLimit = config.getIntValue("fpslimit"); - player_node->setHalfAway(false); - } - setPriority(true); - } - else - { // window minimization -#ifdef ANDROID - client->setState(STATE_EXIT); -#else - client->setIsMinimized(true); - if (player_node && !player_node->getAway()) - { - fpsLimit = config.getIntValue("altfpslimit"); - player_node->setHalfAway(true); - } - setPriority(false); -#endif - } - if (player_node) - player_node->updateStatus(); - } - if (player_node) - player_node->updateName(); - - if (event.active.state & SDL_APPINPUTFOCUS) - client->setInputFocused(event.active.gain); - if (event.active.state & SDL_APPMOUSEFOCUS) - client->setMouseFocused(event.active.gain); - updateFrameRate(fpsLimit); -} -#endif - void Game::updateFrameRate(int fpsLimit) { if (!fpsLimit) |