diff options
Diffstat (limited to 'engines/lure/game.cpp')
-rw-r--r-- | engines/lure/game.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index f9b31c21c5..195ad0fd66 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -23,10 +23,10 @@ * */ -#include "lure/lure.h" #include "lure/game.h" #include "lure/animseq.h" #include "lure/fights.h" +#include "lure/lure.h" #include "lure/res_struct.h" #include "lure/room.h" #include "lure/scripts.h" @@ -125,6 +125,7 @@ void Game::nextFrame() { void Game::execute() { OSystem &system = *g_system; + LureEngine &engine = LureEngine::getReference(); Room &room = Room::getReference(); Resources &res = Resources::getReference(); Events &events = Events::getReference(); @@ -142,7 +143,7 @@ void Game::execute() { setState(GS_RESTART); bool initialRestart = true; - while (!events.quitFlag) { + while (!engine.quit()) { if ((_state & GS_RESTART) != 0) { res.reset(); @@ -162,7 +163,7 @@ void Game::execute() { mouse.cursorOn(); // Main game loop - while (!events.quitFlag && ((_state & GS_RESTART) == 0)) { + while (!engine.quit() && ((_state & GS_RESTART) == 0)) { // If time for next frame, allow everything to update if (system.getMillis() > timerVal + GAME_FRAME_DELAY) { timerVal = system.getMillis(); @@ -291,10 +292,7 @@ void Game::execute() { if (restartFlag) setState(GS_RESTART); - - } else if ((_state & GS_RESTART) == 0) - // Exiting game - events.quitFlag = true; + } } } @@ -892,7 +890,7 @@ void Game::doShowCredits() { void Game::doQuit() { Sound.pause(); if (getYN()) - Events::getReference().quitFlag = true; + LureEngine::getReference().quitGame(); Sound.resume(); } @@ -977,6 +975,7 @@ bool Game::getYN() { Events &events = Events::getReference(); Screen &screen = Screen::getReference(); Resources &res = Resources::getReference(); + LureEngine &engine = LureEngine::getReference(); Common::Language l = LureEngine::getReference().getLanguage(); Common::KeyCode y = Common::KEYCODE_y; @@ -1018,7 +1017,7 @@ bool Game::getYN() { } g_system->delayMillis(10); - } while (!events.quitFlag && !breakFlag); + } while (!engine.quit() && !breakFlag); screen.update(); if (!vKbdFlag) |