diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-16 22:35:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-16 22:35:17 +0300 |
commit | b3d17866a3c5700b52c2b0b954fce132a52c1dbf (patch) | |
tree | 7ba07c98a1842eb766de35e172f559dcf5ac6fb4 /src/dyetool/client.cpp | |
parent | 5e8e53f6e795a84ab5ca6cfe0d08672878044707 (diff) | |
download | manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.gz manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.bz2 manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.tar.xz manaverse-b3d17866a3c5700b52c2b0b954fce132a52c1dbf.zip |
Convert State enum into strong typed.
Diffstat (limited to 'src/dyetool/client.cpp')
-rw-r--r-- | src/dyetool/client.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/dyetool/client.cpp b/src/dyetool/client.cpp index 91a2cbe88..fcd978d12 100644 --- a/src/dyetool/client.cpp +++ b/src/dyetool/client.cpp @@ -113,8 +113,8 @@ Client::Client() : #ifdef ANDROID mCloseButton(nullptr), #endif - mState(STATE_GAME), - mOldState(STATE_START), + mState(State::GAME), + mOldState(State::START), mSkin(nullptr), mButtonPadding(1), mButtonSpacing(3) @@ -286,8 +286,8 @@ void Client::gameInit() if (joystick) joystick->update(); -// if (mState != STATE_ERROR) -// mState = STATE_CHOOSE_SERVER; +// if (mState != State::ERROR) +// mState = State::CHOOSE_SERVER; startTimers(); @@ -336,7 +336,7 @@ void Client::initSoundManager() } catch (const char *const err) { - mState = STATE_ERROR; + mState = State::ERROR; errorMessage = err; logger->log("Warning: %s", err); } @@ -497,7 +497,7 @@ int Client::gameExec() { int lastTickTime = tick_time; - while (mState != STATE_EXIT) + while (mState != State::EXIT) { PROFILER_START(); if (eventsManager.handleEvents()) @@ -551,7 +551,7 @@ int Client::gameExec() BLOCK_END("~Client::SDL_framerateDelay") BLOCK_START("Client::gameExec 6") -// if (mState == STATE_CONNECT_GAME) +// if (mState == State::CONNECT_GAME) // { // stateConnectGame1(); // } @@ -578,13 +578,13 @@ int Client::gameExec() BLOCK_START("Client::gameExec 8") switch (mState) { - case STATE_GAME: + case State::GAME: stateGame(); break; - case STATE_LOAD_DATA: + case State::LOAD_DATA: { - BLOCK_START("Client::gameExec STATE_LOAD_DATA") + BLOCK_START("Client::gameExec State::LOAD_DATA") logger->log1("State: LOAD DATA"); // If another data path has been set, @@ -618,13 +618,13 @@ int Client::gameExec() if (desktop) desktop->reloadWallpaper(); - mState = STATE_GET_CHARACTERS; - BLOCK_END("Client::gameExec STATE_LOAD_DATA") + mState = State::GET_CHARACTERS; + BLOCK_END("Client::gameExec State::LOAD_DATA") break; } - case STATE_START: + case State::START: default: - mState = STATE_FORCE_QUIT; + mState = State::FORCE_QUIT; break; } BLOCK_END("Client::gameExec 8") @@ -642,7 +642,7 @@ void Client::action(const ActionEvent &event) if (eventId == "close") { - setState(STATE_FORCE_QUIT); + setState(State::FORCE_QUIT); return; } if (eventId == "Setup") |