summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-21 21:18:02 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:15 +0300
commita3082da9c7296bb18b7a6bc0424eb2a19d485ff6 (patch)
treecd07d091f69f5a3000aaddcbc8911d472b9137e7 /src/game.cpp
parent84189722a64c0794fbd918b4e6412908be2b7394 (diff)
downloadplus-a3082da9c7296bb18b7a6bc0424eb2a19d485ff6.tar.gz
plus-a3082da9c7296bb18b7a6bc0424eb2a19d485ff6.tar.bz2
plus-a3082da9c7296bb18b7a6bc0424eb2a19d485ff6.tar.xz
plus-a3082da9c7296bb18b7a6bc0424eb2a19d485ff6.zip
second part with compilation fixes for SDL2.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 8c7fbf868..f4dc97ed6 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -880,6 +880,8 @@ void Game::handleActive(const SDL_Event &event)
// 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)
{
@@ -935,6 +937,7 @@ void Game::handleActive(const SDL_Event &event)
}
Client::setFramerate(fpsLimit);
mNextAdjustTime = cur_time + adjustDelay;
+#endif
}
/**
@@ -966,6 +969,22 @@ void Game::handleInput()
switch (event.type)
{
+#ifdef USE_SDL2
+ case SDL_WINDOWEVENT:
+ {
+ switch (event.window.event)
+ {
+ // +++ need add other window events
+ case SDL_WINDOWEVENT_RESIZED:
+ Client::resize(event.window.data1,
+ event.window.data2, false);
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+#else
case SDL_VIDEORESIZE:
// Let the client deal with this one (it'll
// pass down from there)
@@ -975,6 +994,7 @@ void Game::handleInput()
case SDL_ACTIVEEVENT:
handleActive(event);
break;
+#endif
// Quit event
case SDL_QUIT:
Client::setState(STATE_EXIT);