summaryrefslogtreecommitdiff
path: root/src/eventsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-16 22:35:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-16 22:35:17 +0300
commitb3d17866a3c5700b52c2b0b954fce132a52c1dbf (patch)
tree7ba07c98a1842eb766de35e172f559dcf5ac6fb4 /src/eventsmanager.cpp
parent5e8e53f6e795a84ab5ca6cfe0d08672878044707 (diff)
downloadmanaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.gz
manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.bz2
manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.xz
manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.zip
Convert State enum into strong typed.
Diffstat (limited to 'src/eventsmanager.cpp')
-rw-r--r--src/eventsmanager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index 3125e398b..157860515 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -78,7 +78,7 @@ bool EventsManager::handleCommonEvents(const SDL_Event &event) const
switch (event.type)
{
case SDL_QUIT:
- client->setState(STATE_EXIT);
+ client->setState(State::EXIT);
logger->log1("force exit");
BLOCK_END("EventsManager::handleCommonEvents")
return true;
@@ -147,7 +147,7 @@ bool EventsManager::handleEvents() const
if ((event.active.state & SDL_APPACTIVE)
&& !event.active.gain)
{
- client->setState(STATE_EXIT);
+ client->setState(State::EXIT);
logger->log1("exit on lost focus");
}
break;
@@ -170,7 +170,7 @@ bool EventsManager::handleEvents() const
}
#endif
}
- if (client->getState() == STATE_EXIT)
+ if (client->getState() == State::EXIT)
{
BLOCK_END("EventsManager::handleEvents")
return true;
@@ -431,7 +431,7 @@ void EventsManager::handleSDL2WindowEvent(const SDL_Event &event)
int fpsLimit = 0;
#endif
const int eventType = event.window.event;
- const bool inGame = (client->getState() == STATE_GAME);
+ const bool inGame = (client->getState() == State::GAME);
switch (eventType)
{
case SDL_WINDOWEVENT_RESIZED:
@@ -507,7 +507,7 @@ void EventsManager::handleActive(const SDL_Event &event)
{
#ifndef DYECMD
int fpsLimit = 0;
- const bool inGame = (client->getState() == STATE_GAME);
+ const bool inGame = (client->getState() == State::GAME);
#endif
if (event.active.state & SDL_APPACTIVE)
{
@@ -527,7 +527,7 @@ void EventsManager::handleActive(const SDL_Event &event)
else
{ // window minimization
#ifdef ANDROID
- client->setState(STATE_EXIT);
+ client->setState(State::EXIT);
#else
WindowManager::setIsMinimized(true);
#ifndef DYECMD