From a81f13c14ed9177d0cbf1dc6f173e195c12d9ee2 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 24 Jun 2013 23:48:00 +0200 Subject: MORTEVIELLE: Remove CHECK_QUIT macros --- engines/mortevielle/actions.cpp | 3 ++- engines/mortevielle/dialogs.cpp | 9 ++++++--- engines/mortevielle/mortevielle.cpp | 26 +++++++++++++++++--------- engines/mortevielle/mortevielle.h | 3 --- engines/mortevielle/mouse.cpp | 3 ++- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 392ea17df1..47ffb2e4ba 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -1408,7 +1408,8 @@ void MortevielleEngine::fctDiscuss() { do { bool dummyFl; _mouse.moveMouse(dummyFl, retKey); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; _mouse.getMousePosition(x, y, click); x *= (3 - _resolutionScaler); diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp index ee6eb697fb..90c53d1648 100644 --- a/engines/mortevielle/dialogs.cpp +++ b/engines/mortevielle/dialogs.cpp @@ -110,7 +110,8 @@ int Alert::show(const Common::String &msg, int n) { do { char dummyKey = '\377'; g_vm->_mouse.moveMouse(dummyFl, dummyKey); - CHECK_QUIT0; + if (g_vm->shouldQuit()) + return 0; curPos = g_vm->_mouse._pos; bool newaff = false; @@ -358,7 +359,8 @@ bool KnowledgeCheck::show() { bool flag; char key; g_vm->_mouse.moveMouse(flag, key); - CHECK_QUIT0; + if (g_vm->shouldQuit()) + return false; currChoice = 1; while (coor[currChoice]._enabled && !g_vm->_mouse.isMouseIn(coor[currChoice]._rect)) @@ -428,7 +430,8 @@ void f3f8::checkForF8(int SpeechNum, bool drawAni50Fl) { do { g_vm->_speechManager.startSpeech(SpeechNum, 0, 0); g_vm->_key = waitForF3F8(); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; if (g_vm->_newGraphicalDevice != g_vm->_currGraphicalDevice) { g_vm->_currGraphicalDevice = g_vm->_newGraphicalDevice; diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp index 664908440f..b013f87a1a 100644 --- a/engines/mortevielle/mortevielle.cpp +++ b/engines/mortevielle/mortevielle.cpp @@ -576,13 +576,15 @@ void MortevielleEngine::showIntroduction() { f3f8::aff50(false); _speechManager._mlec = 0; f3f8::checkForF8(142, false); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; f3f8::ani50(); f3f8::checkForF8(143, true); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; - // TODO: Once music is implemented, only use the below delay if music is turned off + // TODO: Once music (Amiga/Atari ports) is implemented, only use the below delay if music is turned off showTitleScreen(); delay(3000); music(); @@ -611,7 +613,8 @@ void MortevielleEngine::mainGame() { // Loop to play the game do { playGame(); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; } while (!_quitGame); } @@ -625,7 +628,8 @@ void MortevielleEngine::playGame() { // Loop handling actions until the game has to be quit, or show the lose or end sequence do { handleAction(); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; } while (!((_quitGame) || (_endGame) || (_loseGame))); if (_endGame) @@ -660,7 +664,8 @@ void MortevielleEngine::handleAction() { _menu.updateMenu(); prepareRoom(); _mouse.moveMouse(funct, inkey); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; ++temps; } while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone))); _inMainGameLoop = false; @@ -1748,7 +1753,8 @@ void MortevielleEngine::startDialog(int16 rep) { do { _speechManager.startSpeech(rep, haut[_caff - 69], 0); key = f3f8::waitForF3F8(); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; } while (key != 66); hirs(); _mouse.showMouse(); @@ -3383,7 +3389,8 @@ void MortevielleEngine::testKey(bool d) { prepareRoom(); quest = keyPressed(); _mouse.getMousePosition(x, y, click); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; } while (!(quest || (click) || (d && _anyone))); if (quest) testou(); @@ -3618,7 +3625,8 @@ void MortevielleEngine::tfleche() { do { _mouse.moveMouse(qust, touch); - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; if (getMouseClick()) inRect = (_mouse._pos.x < 256 * _resolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12); diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h index aeef3dd1e2..bdf28e4514 100644 --- a/engines/mortevielle/mortevielle.h +++ b/engines/mortevielle/mortevielle.h @@ -533,9 +533,6 @@ public: extern MortevielleEngine *g_vm; -#define CHECK_QUIT if (g_vm->shouldQuit()) { return; } -#define CHECK_QUIT0 if (g_vm->shouldQuit()) { return 0; } - } // End of namespace Mortevielle #endif diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp index bc0f5fe7d3..a6105d85de 100644 --- a/engines/mortevielle/mouse.cpp +++ b/engines/mortevielle/mouse.cpp @@ -265,7 +265,8 @@ void MouseHandler::moveMouse(bool &funct, char &key) { // Handle any pending keypresses while (p_key) { - CHECK_QUIT; + if (g_vm->shouldQuit()) + return; in1 = g_vm->getChar(); getMousePosition(cx, cy, click); -- cgit v1.2.3