From 9b160804ab8878b55efb032fb62ee359ab97f848 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 30 Sep 2008 12:27:38 +0000 Subject: Renamed Engine::quit to Engine::shouldQuit (previously, it was easily confused with Engine::quitGame); also cleaned up engine.h a bit svn-id: r34700 --- engines/kyra/gui.cpp | 4 ++-- engines/kyra/gui_hof.cpp | 2 +- engines/kyra/gui_lok.cpp | 12 ++++++------ engines/kyra/gui_mr.cpp | 2 +- engines/kyra/gui_v2.cpp | 4 ++-- engines/kyra/kyra_hof.cpp | 10 +++++----- engines/kyra/kyra_lok.cpp | 12 ++++++------ engines/kyra/kyra_mr.cpp | 10 +++++----- engines/kyra/kyra_v1.cpp | 2 +- engines/kyra/kyra_v2.cpp | 2 +- engines/kyra/lol.cpp | 30 +++++++++++++++--------------- engines/kyra/saveload.cpp | 2 +- engines/kyra/saveload_lok.cpp | 2 +- engines/kyra/scene_hof.cpp | 2 +- engines/kyra/scene_mr.cpp | 2 +- engines/kyra/screen.cpp | 8 ++++---- engines/kyra/script.cpp | 2 +- engines/kyra/script_lok.cpp | 1 - engines/kyra/script_mr.cpp | 2 +- engines/kyra/seqplayer.cpp | 2 +- engines/kyra/sequences_hof.cpp | 22 +++++++++++----------- engines/kyra/sequences_lok.cpp | 14 +++++++------- engines/kyra/text.cpp | 2 -- engines/kyra/text_hof.cpp | 12 ++++++------ engines/kyra/text_mr.cpp | 10 +++++----- 25 files changed, 85 insertions(+), 88 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 6864bd9c4d..06d7f1783a 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -427,7 +427,7 @@ int MainMenu::handle(int dim) { Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * 4); - while (!_vm->quit()) { + while (!_vm->shouldQuit()) { updateAnimation(); bool mousePressed = getInput(); @@ -458,7 +458,7 @@ int MainMenu::handle(int dim) { _system->delayMillis(10); } - if (_vm->quit()) + if (_vm->shouldQuit()) command = -1; _screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 3, 0); diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index a1391320f4..79db2b8b80 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -514,7 +514,7 @@ void KyraEngine_HoF::bookLoop() { showBookPage(); _bookShown = true; - while (_bookShown && !quit()) { + while (_bookShown && !shouldQuit()) { checkInput(buttonList); removeInputTop(); diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 4efffb0eda..e097a422f2 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -473,7 +473,7 @@ int GUI_LoK::buttonMenuCallback(Button *caller) { updateAllMenuButtons(); } - while (_displayMenu && !_vm->quit()) { + while (_displayMenu && !_vm->shouldQuit()) { Common::Point mouse = _vm->getMousePos(); processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y); processButtonList(_menuButtonList, 0, 0); @@ -593,7 +593,7 @@ int GUI_LoK::saveGameMenu(Button *button) { _displaySubMenu = true; _cancelSubMenu = false; - while (_displaySubMenu && !_vm->quit()) { + while (_displaySubMenu && !_vm->shouldQuit()) { getInput(); Common::Point mouse = _vm->getMousePos(); processHighlights(_menu[2], mouse.x, mouse.y); @@ -642,7 +642,7 @@ int GUI_LoK::loadGameMenu(Button *button) { _vm->_gameToLoad = -1; - while (_displaySubMenu && !_vm->quit()) { + while (_displaySubMenu && !_vm->shouldQuit()) { getInput(); Common::Point mouse = _vm->getMousePos(); processHighlights(_menu[2], mouse.x, mouse.y); @@ -730,7 +730,7 @@ int GUI_LoK::saveGame(Button *button) { } redrawTextfield(); - while (_displaySubMenu && !_vm->quit()) { + while (_displaySubMenu && !_vm->shouldQuit()) { getInput(); updateSavegameString(); Common::Point mouse = _vm->getMousePos(); @@ -810,7 +810,7 @@ bool GUI_LoK::quitConfirm(const char *str) { _displaySubMenu = true; _cancelSubMenu = true; - while (_displaySubMenu && !_vm->quit()) { + while (_displaySubMenu && !_vm->shouldQuit()) { getInput(); Common::Point mouse = _vm->getMousePos(); processHighlights(_menu[1], mouse.x, mouse.y); @@ -876,7 +876,7 @@ int GUI_LoK::gameControlsMenu(Button *button) { _displaySubMenu = true; _cancelSubMenu = false; - while (_displaySubMenu && !_vm->quit()) { + while (_displaySubMenu && !_vm->shouldQuit()) { getInput(); Common::Point mouse = _vm->getMousePos(); processHighlights(_menu[5], mouse.x, mouse.y); diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 72f214f001..9f6748cd9b 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -870,7 +870,7 @@ void KyraEngine_MR::processAlbum() { albumNewPage(); _album.running = true; - while (_album.running && !quit()) { + while (_album.running && !shouldQuit()) { updateInput(); checkInput(buttonList); removeInputTop(); diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 077e49ebcf..9c5e86ad98 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -409,7 +409,7 @@ void GUI_v2::getInput() { _vm->checkInput(_menuButtonList); _vm->removeInputTop(); - if (_vm->quit()) { + if (_vm->shouldQuit()) { _displayMenu = false; _isLoadMenu = false; _isSaveMenu = false; @@ -749,7 +749,7 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8 _keyPressed.reset(); _cancelNameInput = _finishNameInput = false; - while (running && !_vm->quit()) { + while (running && !_vm->shouldQuit()) { processHighlights(_savenameMenu, _vm->_mouseX, _vm->_mouseY); checkTextfieldInput(); if (_keyPressed.keycode == Common::KEYCODE_RETURN || _keyPressed.keycode == Common::KEYCODE_KP_ENTER || _finishNameInput) { diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 76d6f6ea05..e5043f0c4e 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -317,7 +317,7 @@ int KyraEngine_HoF::go() { if (_menuChoice & 1) { startup(); - if (!quit()) + if (!shouldQuit()) runLoop(); cleanup(); @@ -455,7 +455,7 @@ void KyraEngine_HoF::runLoop() { _screen->updateScreen(); _runFlag = true; - while (!quit() && _runFlag) { + while (!shouldQuit() && _runFlag) { if (_deathHandler >= 0) { removeHandItem(); delay(5); @@ -463,7 +463,7 @@ void KyraEngine_HoF::runLoop() { _gui->optionsButton(0); _deathHandler = -1; - if (!_runFlag || !quit()) + if (!_runFlag || !shouldQuit()) break; } @@ -1630,7 +1630,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, in _invWsa.timer = _system->getMillis(); if (run) { - while (_invWsa.running && !skipFlag() && !quit()) { + while (_invWsa.running && !skipFlag() && !shouldQuit()) { update(); _system->delayMillis(10); } @@ -2004,7 +2004,7 @@ void KyraEngine_HoF::playTim(const char *filename) { return; _tim->resetFinishedFlag(); - while (!quit() && !_tim->finished()) { + while (!shouldQuit() && !_tim->finished()) { _tim->exec(tim, 0); if (_chatText) updateWithText(); diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index f71cc8f409..5a3376a3e6 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -303,7 +303,7 @@ int KyraEngine_LoK::go() { if (_gameToLoad == -1) { setGameFlag(0xEF); seq_intro(); - if (quit()) + if (shouldQuit()) return 0; if (_skipIntroFlag && _abortIntroFlag) resetGameFlag(0xEF); @@ -402,7 +402,7 @@ void KyraEngine_LoK::startup() { void KyraEngine_LoK::mainLoop() { debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()"); - while (!quit()) { + while (!shouldQuit()) { int32 frameTime = (int32)_system->getMillis(); _skipFlag = false; @@ -449,7 +449,7 @@ void KyraEngine_LoK::mainLoop() { } void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) { - while (_system->getMillis() < timestamp && !quit()) { + while (_system->getMillis() < timestamp && !shouldQuit()) { if (updateTimers) _timer->update(); @@ -531,19 +531,19 @@ void KyraEngine_LoK::delay(uint32 amount, bool update, bool isMainLoop) { if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE)) _skipFlag = false; - if (amount > 0 && !_skipFlag && !quit()) + if (amount > 0 && !_skipFlag && !shouldQuit()) _system->delayMillis(10); if (_skipFlag) _sound->voiceStop(); - } while (!_skipFlag && _system->getMillis() < start + amount && !quit()); + } while (!_skipFlag && _system->getMillis() < start + amount && !shouldQuit()); } void KyraEngine_LoK::waitForEvent() { bool finished = false; Common::Event event; - while (!finished && !quit()) { + while (!finished && !shouldQuit()) { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_KEYDOWN: diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 9d3171e723..7dea56a5fa 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -263,7 +263,7 @@ int KyraEngine_MR::go() { running = false; } - while (running && !quit()) { + while (running && !shouldQuit()) { _screen->_curPage = 0; _screen->clearPage(0); @@ -272,14 +272,14 @@ int KyraEngine_MR::go() { // XXX playMenuAudioFile(); - for (int i = 0; i < 64 && !quit(); ++i) { + for (int i = 0; i < 64 && !shouldQuit(); ++i) { uint32 nextRun = _system->getMillis() + 3 * _tickLength; _menuAnim->displayFrame(i, 0); _screen->updateScreen(); delayUntil(nextRun); } - for (int i = 64; i > 29 && !quit(); --i) { + for (int i = 64; i > 29 && !shouldQuit(); --i) { uint32 nextRun = _system->getMillis() + 3 * _tickLength; _menuAnim->displayFrame(i, 0); _screen->updateScreen(); @@ -1001,7 +1001,7 @@ void KyraEngine_MR::runLoop() { _eventList.clear(); _runFlag = true; - while (_runFlag && !quit()) { + while (_runFlag && !shouldQuit()) { if (_deathHandler >= 0) { removeHandItem(); delay(5); @@ -1009,7 +1009,7 @@ void KyraEngine_MR::runLoop() { _gui->optionsButton(0); _deathHandler = -1; - if (quit()) + if (shouldQuit()) break; } diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 8162232935..2a6cfb6f06 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -235,7 +235,7 @@ int KyraEngine_v1::resetGameFlag(int flag) { } void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) { - while (_system->getMillis() < timestamp && !quit()) { + while (_system->getMillis() < timestamp && !shouldQuit()) { if (timestamp - _system->getMillis() >= 10) delay(10, update, isMainLoop); } diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index e9ed91b539..a1124bf98d 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -159,7 +159,7 @@ void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) { if (amount > 0) _system->delayMillis(amount > 10 ? 10 : amount); - } while (!skipFlag() && _system->getMillis() < start + amount && !quit()); + } while (!skipFlag() && _system->getMillis() < start + amount && !shouldQuit()); } int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 053d8a4de9..91c9b65d1e 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -297,7 +297,7 @@ void LoLEngine::showIntro() { _screen->hideMouse(); uint32 palNextFadeStep = 0; - while (!_tim->finished() && !quit() && !skipFlag()) { + while (!_tim->finished() && !shouldQuit() && !skipFlag()) { updateInput(); _tim->exec(intro, false); _screen->checkedPageUpdate(8, 4); @@ -375,14 +375,14 @@ int LoLEngine::chooseCharacter() { _screen->fadePalette(_screen->getPalette(0), 30, 0); bool kingIntro = true; - while (!quit()) { + while (!shouldQuit()) { if (kingIntro) kingSelectionIntro(); if (_charSelection < 0) processCharacterSelection(); - if (quit()) + if (shouldQuit()) break; if (_charSelection == 100) { @@ -403,11 +403,11 @@ int LoLEngine::chooseCharacter() { } } - if (quit()) + if (shouldQuit()) return -1; uint32 waitTime = _system->getMillis() + 420 * _tickLength; - while (waitTime > _system->getMillis() && !skipFlag() && !quit()) { + while (waitTime > _system->getMillis() && !skipFlag() && !shouldQuit()) { updateInput(); _system->delayMillis(10); } @@ -439,7 +439,7 @@ void LoLEngine::kingSelectionIntro() { _chargenWSA->setDrawPage(0); int index = 4; - while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !quit() && !skipFlag()) { + while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !shouldQuit() && !skipFlag()) { index = MAX(index, 4); _chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0); @@ -450,7 +450,7 @@ void LoLEngine::kingSelectionIntro() { _screen->updateScreen(); uint32 waitEnd = _system->getMillis() + 7 * _tickLength; - while (waitEnd > _system->getMillis() && _charSelection == -1 && !quit() && !skipFlag()) { + while (waitEnd > _system->getMillis() && _charSelection == -1 && !shouldQuit() && !skipFlag()) { _charSelection = getCharSelection(); _system->delayMillis(10); } @@ -481,7 +481,7 @@ void LoLEngine::kingSelectionReminder() { _chargenWSA->setDrawPage(0); int index = 0; - while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !quit() && index < 15) { + while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !shouldQuit() && index < 15) { _chargenWSA->displayFrame(_chargenFrameTable[index+9], 0, 0, 0); _screen->copyRegion(_selectionPosTable[_reminderChar1IdxTable[index]*2+0], _selectionPosTable[_reminderChar1IdxTable[index]*2+1], _charPreviews[0].x, _charPreviews[0].y, 32, 32, 4, 0); _screen->copyRegion(_selectionPosTable[_reminderChar2IdxTable[index]*2+0], _selectionPosTable[_reminderChar2IdxTable[index]*2+1], _charPreviews[1].x, _charPreviews[1].y, 32, 32, 4, 0); @@ -490,7 +490,7 @@ void LoLEngine::kingSelectionReminder() { _screen->updateScreen(); uint32 waitEnd = _system->getMillis() + 8 * _tickLength; - while (waitEnd > _system->getMillis() && !quit()) { + while (waitEnd > _system->getMillis() && !shouldQuit()) { _charSelection = getCharSelection(); _system->delayMillis(10); } @@ -511,14 +511,14 @@ void LoLEngine::kingSelectionOutro() { _chargenWSA->setDrawPage(0); int index = 0; - while (_sound->voiceIsPlaying("KING03") && !quit() && !skipFlag()) { + while (_sound->voiceIsPlaying("KING03") && !shouldQuit() && !skipFlag()) { index = MAX(index, 4); _chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0); _screen->updateScreen(); uint32 waitEnd = _system->getMillis() + 8 * _tickLength; - while (waitEnd > _system->getMillis() && !quit() && !skipFlag()) { + while (waitEnd > _system->getMillis() && !shouldQuit() && !skipFlag()) { updateInput(); _system->delayMillis(10); } @@ -537,10 +537,10 @@ void LoLEngine::processCharacterSelection() { debugC(9, kDebugLevelMain, "LoLEngine::processCharacterSelection()"); _charSelection = -1; - while (!quit() && _charSelection == -1) { + while (!shouldQuit() && _charSelection == -1) { uint32 nextKingMessage = _system->getMillis() + 900 * _tickLength; - while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !quit()) { + while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !shouldQuit()) { updateSelectionAnims(); _charSelection = getCharSelection(); _system->delayMillis(10); @@ -659,12 +659,12 @@ void LoLEngine::selectionCharInfoIntro(char *file) { int index = 0; file[4] = '0'; - while (_charSelectionInfoResult == -1 && !quit()) { + while (_charSelectionInfoResult == -1 && !shouldQuit()) { if (!_sound->voicePlay(file)) break; int i = 0; - while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !quit()) { + while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !shouldQuit()) { _screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0); _screen->updateScreen(); diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 76089fdb2c..d094dd1ccb 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -179,7 +179,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName, const Graphics::Surface *thumbnail) const { debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s', %p)", filename, saveName, (const void *)thumbnail); - if (quit()) + if (shouldQuit()) return 0; Common::WriteStream *out = 0; diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index f0d9f1ba82..051b844703 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -221,7 +221,7 @@ void KyraEngine_LoK::loadGame(const char *fileName) { void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName, const Graphics::Surface *thumb) { debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s', %p)", fileName, saveName, (const void *)thumb); - if (quit()) + if (shouldQuit()) return; Common::OutSaveFile *out = openSaveForWriting(fileName, saveName, thumb); diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index df9fccaab9..4785b039d7 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -277,7 +277,7 @@ int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) { int changedScene = 0; const int *moveTableStart = moveTable; _unk4 = 0; - while (running && !quit()) { + while (running && !shouldQuit()) { if (*moveTable >= 0 && *moveTable <= 7) { _mainCharacter.facing = getOppositeFacingDirection(*moveTable); unkFlag = true; diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index ad4ce63b6c..1ceb47155d 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -654,7 +654,7 @@ int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) { const int *moveTableStart = moveTable; _unk4 = 0; - while (running && !quit()) { + while (running && !shouldQuit()) { if (*moveTable >= 0 && *moveTable <= 7) { _mainCharacter.facing = getOppositeFacingDirection(*moveTable); unkFlag = true; diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 4bcde9a679..d7c603fe11 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -384,7 +384,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u getFadeParams(palData, delay, delayInc, diff); int delayAcc = 0; - while (!_vm->quit()) { + while (!_vm->shouldQuit()) { delayAcc += delayInc; int refreshed = fadePalStep(palData, diff); @@ -401,7 +401,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u delayAcc &= 0xFF; } - if (_vm->quit()) { + if (_vm->shouldQuit()) { setScreenPalette(palData); if (upFunc && upFunc->isValid()) (*upFunc)(); @@ -750,7 +750,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag int32 start, now; int wait; - for (y = 0; y < h && !_vm->quit(); ++y) { + for (y = 0; y < h && !_vm->shouldQuit(); ++y) { start = (int32)_system->getMillis(); int y_cur = y; for (x = 0; x < w; ++x) { @@ -775,7 +775,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag copyOverlayRegion(sx, sy, sx, sy, w, h, srcPage, dstPage); - if (_vm->quit()) { + if (_vm->shouldQuit()) { copyRegion(sx, sy, sx, sy, w, h, srcPage, dstPage); _system->updateScreen(); } diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index dba09f08ef..9635b0b29a 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -178,7 +178,7 @@ bool EMCInterpreter::start(EMCState *script, int function) { } bool EMCInterpreter::isValid(EMCState *script) { - if (!script->ip || !script->dataPtr || _vm->quit()) + if (!script->ip || !script->dataPtr || _vm->shouldQuit()) return false; return true; } diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index e965a075bd..b0fc4b860c 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -23,7 +23,6 @@ * */ - #include "common/endian.h" #include "common/system.h" diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index bc71e72ce4..3e709d45e5 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -786,7 +786,7 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) { _screen->_curPage = curPageBackUp; _screen->showMouse(); - while (!quit()) { + while (!shouldQuit()) { int keys = checkInput(0); removeInputTop(); diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index dfda5bf859..3391c51ab7 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -625,7 +625,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) { memset(_seqMovies, 0, sizeof(_seqMovies)); _screen->_curPage = 0; - while (!_seqQuitFlag && !_vm->quit()) { + while (!_seqQuitFlag && !_vm->shouldQuit()) { if (skipSeq && _vm->seq_skipSequence()) { while (1) { uint8 code = *_seqData; diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 7915a33996..718c8dadfa 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -75,7 +75,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { _seqEndTime = 0; _menuChoice = 0; - for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) { + for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) { _screen->clearPage(0); _screen->clearPage(8); memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300); @@ -131,7 +131,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { seq_sequenceCommand(cseq.startupCommand); - if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _screen->copyPage(2, 0); _screen->updateScreen(); } @@ -165,7 +165,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { _seqWsaCurrentFrame = cseq.startFrame; bool loop = true; - while (loop && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + while (loop && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength; if (_seqWsa || !cb) @@ -189,16 +189,16 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { seq_processWSAs(); seq_processText(); - if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _screen->copyPage(2, 0); _screen->updateScreen(); } bool loop2 = true; - while (loop2 && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + while (loop2 && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { if (_seqWsa) { seq_processText(); - if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _screen->copyPage(2, 0); _screen->updateScreen(); } @@ -230,7 +230,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { } else { _seqFrameDelay = cseq.frameDelay; _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength; - while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _seqSubFrameStartTime = _system->getMillis(); seq_processWSAs(); if (cb) @@ -262,7 +262,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { dl = ct; _seqEndTime = _system->getMillis() + dl; - while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { + while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { _seqSubFrameStartTime = _system->getMillis(); seq_processWSAs(); @@ -2267,7 +2267,7 @@ void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) { void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) { int xa = 0, ya = 0; command--; - if (!_activeWSA[wsaNum].movie || skipFlag() || quit() || _abortIntroFlag) + if (!_activeWSA[wsaNum].movie || skipFlag() || shouldQuit() || _abortIntroFlag) return; switch (command) { @@ -2467,7 +2467,7 @@ bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) { void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) { uint8 colormap[16]; - if (skipFlag() || quit() || _abortIntroFlag || _menuChoice) + if (skipFlag() || shouldQuit() || _abortIntroFlag || _menuChoice) return; memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6); @@ -2957,7 +2957,7 @@ void KyraEngine_HoF::seq_makeBookAppear() { ++_invWsa.curFrame; - if (_invWsa.curFrame >= _invWsa.lastFrame && !quit()) + if (_invWsa.curFrame >= _invWsa.lastFrame && !shouldQuit()) break; switch (_invWsa.curFrame) { diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 77cfbed2d0..c9c1a05842 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -163,7 +163,7 @@ void KyraEngine_LoK::seq_introLogos() { _screen->updateScreen(); _screen->fadeFromBlack(); - if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || quit()) { + if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || shouldQuit()) { _screen->fadeToBlack(); _screen->clearPage(0); return; @@ -175,14 +175,14 @@ void KyraEngine_LoK::seq_introLogos() { _screen->setScreenPalette(_screen->_currentPalette); } - if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || quit()) { + if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || shouldQuit()) { _screen->fadeToBlack(); _screen->clearPage(0); return; } _screen->fillRect(0, 179, 319, 199, 0); - if (quit()) + if (shouldQuit()) return; if (_flags.platform == Common::kPlatformAmiga) { @@ -222,10 +222,10 @@ void KyraEngine_LoK::seq_introLogos() { oldDistance = distance; delay(10); - } while (!doneFlag && !quit() && !_abortIntroFlag); + } while (!doneFlag && !shouldQuit() && !_abortIntroFlag); } - if (quit()) + if (shouldQuit()) return; _seq->playSequence(_seq_Forest, true); @@ -1029,7 +1029,7 @@ void KyraEngine_LoK::seq_brandonToStone() { void KyraEngine_LoK::seq_playEnding() { debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()"); - if (quit()) + if (shouldQuit()) return; _screen->hideMouse(); _screen->_curPage = 0; @@ -1210,7 +1210,7 @@ void KyraEngine_LoK::seq_playCredits() { bool KyraEngine_LoK::seq_skipSequence() const { debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()"); - return quit() || _abortIntroFlag; + return shouldQuit() || _abortIntroFlag; } int KyraEngine_LoK::handleMalcolmFlag() { diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index eecb617942..379772365c 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -23,8 +23,6 @@ * */ - - #include "kyra/kyra_v1.h" #include "kyra/screen.h" #include "kyra/text.h" diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index b94b8a6258..15681e074c 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -335,7 +335,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() { const uint32 endTime = _chatEndTime; resetSkipFlag(); - while (running && !quit()) { + while (running && !shouldQuit()) { if (!_emc->isValid(&_chatScriptState)) _emc->start(&_chatScriptState, 1); @@ -353,7 +353,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() { uint32 nextFrame = _system->getMillis() + delayTime * _tickLength; - while (_system->getMillis() < nextFrame && !quit()) { + while (_system->getMillis() < nextFrame && !shouldQuit()) { updateWithText(); const uint32 curTime = _system->getMillis(); @@ -593,7 +593,7 @@ void KyraEngine_HoF::initTalkObject(int index) { if (_currentTalkSections.STATim) { _tim->resetFinishedFlag(); - while (!quit() && !_tim->finished()) { + while (!shouldQuit() && !_tim->finished()) { _tim->exec(_currentTalkSections.STATim, false); if (_chatText) updateWithText(); @@ -609,7 +609,7 @@ void KyraEngine_HoF::deinitTalkObject(int index) { if (_currentTalkSections.ENDTim) { _tim->resetFinishedFlag(); - while (!quit() && !_tim->finished()) { + while (!shouldQuit() && !_tim->finished()) { _tim->exec(_currentTalkSections.ENDTim, false); if (_chatText) updateWithText(); @@ -647,10 +647,10 @@ void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh, _chatVocHigh = _chatVocLow = -1; } - while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(quit() || skipFlag())) { + while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(shouldQuit() || skipFlag())) { if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) { _tim->resetFinishedFlag(); - while (!_tim->finished() && !skipFlag() && !quit()) { + while (!_tim->finished() && !skipFlag() && !shouldQuit()) { if (_currentTalkSections.TLKTim) _tim->exec(_currentTalkSections.TLKTim, false); else diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index be306ceec1..41b4c30245 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -349,7 +349,7 @@ void KyraEngine_MR::objectChatWaitToFinish() { const uint32 endTime = _chatEndTime; resetSkipFlag(); - while (running && !quit()) { + while (running && !shouldQuit()) { if (!_emc->isValid(&_chatScriptState)) _emc->start(&_chatScriptState, 1); @@ -367,7 +367,7 @@ void KyraEngine_MR::objectChatWaitToFinish() { uint32 nextFrame = _system->getMillis() + delayTime * _tickLength; - while (_system->getMillis() < nextFrame && !quit()) { + while (_system->getMillis() < nextFrame && !shouldQuit()) { updateWithText(); const uint32 curTime = _system->getMillis(); @@ -419,7 +419,7 @@ void KyraEngine_MR::badConscienceChatWaitToFinish() { uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength; int frame = _badConscienceFrameTable[_badConscienceAnim+24]; - while (running && !quit()) { + while (running && !shouldQuit()) { if (nextFrame < _system->getMillis()) { ++frame; if (_badConscienceFrameTable[_badConscienceAnim+32] < frame) @@ -477,7 +477,7 @@ void KyraEngine_MR::goodConscienceChatWaitToFinish() { uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength; int frame = _goodConscienceFrameTable[_goodConscienceAnim+15]; - while (running && !quit()) { + while (running && !shouldQuit()) { if (nextFrame < _system->getMillis()) { ++frame; if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame) @@ -597,7 +597,7 @@ void KyraEngine_MR::albumChatWaitToFinish() { uint32 nextFrame = 0; int frame = 12; - while (running && !quit()) { + while (running && !shouldQuit()) { if (nextFrame < _system->getMillis()) { ++frame; if (frame > 22) -- cgit v1.2.3