From 8d8c46e36fade04d4452f0ce1fbdd3ee942ac898 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 13 Aug 2008 20:45:00 +0000 Subject: Cleanup: Got rid of _quit and _rtl variables in engine.h/.cpp which are not used anymore. Found some _quit flags in Agos and Gob and replaced with bool quit() where appropriate svn-id: r33848 --- engines/agos/animation.cpp | 2 +- engines/agos/input.cpp | 4 ++-- engines/agos/oracle.cpp | 2 +- engines/agos/saveload.cpp | 16 ++++++++-------- engines/agos/script.cpp | 2 +- engines/agos/script_e1.cpp | 8 ++++---- engines/agos/script_e2.cpp | 4 ++-- engines/agos/script_s1.cpp | 2 +- engines/agos/script_ww.cpp | 4 ++-- engines/agos/verb.cpp | 2 +- engines/agos/window.cpp | 4 ++-- engines/engine.cpp | 4 +--- engines/engine.h | 2 -- engines/gob/sound/sound.cpp | 2 +- 14 files changed, 27 insertions(+), 31 deletions(-) diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index f29baefde1..f4abf19645 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -150,7 +150,7 @@ void MoviePlayer::play() { startSound(); - while (_frameNum < _framesCount && !_vm->_quit) + while (_frameNum < _framesCount && !_vm->quit()) handleNextFrame(); closeFile(); diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index ca6b67fa61..689dee610a 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -123,7 +123,7 @@ void AGOSEngine::setup_cond_c_helper() { clearName(); _lastNameOn = last; - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = 0; _leftButtonDown = 0; @@ -145,7 +145,7 @@ void AGOSEngine::setup_cond_c_helper() { } delay(100); - } while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !_quit); + } while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !quit()); if (_lastHitArea == NULL) { } else if (_lastHitArea->id == 0x7FFB) { diff --git a/engines/agos/oracle.cpp b/engines/agos/oracle.cpp index 2d2feb7b9e..c174362e7c 100644 --- a/engines/agos/oracle.cpp +++ b/engines/agos/oracle.cpp @@ -459,7 +459,7 @@ void AGOSEngine_Feeble::saveUserGame(int slot) { } windowPutChar(window, 0x7f); - while (!_quit) { + while (!quit()) { _keyPressed.reset(); delay(1); diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index 9779630d47..90a48b88a2 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -279,11 +279,11 @@ restart: name = buf; _saveGameNameLen = 0; - while (!_quit) { + while (!quit()) { windowPutChar(window, 128); _keyPressed.reset(); - while (!_quit) { + while (!quit()) { delay(10); if (_keyPressed.ascii && _keyPressed.ascii < 128) { i = _keyPressed.ascii; @@ -443,7 +443,7 @@ void AGOSEngine_Elvira2::userGame(bool load) { name = buf + 192; - while (!_quit) { + while (!quit()) { windowPutChar(window, 128); _saveLoadEdit = true; @@ -516,7 +516,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) { _keyPressed.reset(); - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; @@ -526,7 +526,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) { return _keyPressed.ascii; } delay(10); - } while (_lastHitArea3 == 0 && !_quit); + } while (_lastHitArea3 == 0 && !quit()); ha = _lastHitArea; if (ha == NULL || ha->id < 200) { @@ -708,7 +708,7 @@ restart:; _saveGameNameLen++; } - while (!_quit) { + while (!quit()) { windowPutChar(window, 127); _saveLoadEdit = true; @@ -787,7 +787,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) { _keyPressed.reset(); - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; @@ -797,7 +797,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) { return _keyPressed.ascii; } delay(10); - } while (_lastHitArea3 == 0 && !_quit); + } while (_lastHitArea3 == 0 && !quit()); ha = _lastHitArea; if (ha == NULL || ha->id < 205) { diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 2a2ddeeb86..39c172be62 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -1012,7 +1012,7 @@ int AGOSEngine::runScript() { executeOpcode(_opcode); } while (getScriptCondition() != flag && !getScriptReturn() && !quit()); - return (_quit) ? 1 : getScriptReturn(); + return (quit()) ? 1 : getScriptReturn(); } Child *nextSub(Child *sub, int16 key) { diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index d3ee4297c0..8705755df6 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -1052,11 +1052,11 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) { ha->priority = 999; ha->window = 0; - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; - while (!_quit) { + while (!quit()) { if (_lastHitArea3 != 0) break; delay(1); @@ -1101,11 +1101,11 @@ uint AGOSEngine::continueOrQuit() { ha->priority = 999; ha->window = 0; - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; - while (!_quit) { + while (!quit()) { if (_lastHitArea3 != 0) break; delay(1); diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index 6f6db8efb4..05e457579d 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -370,11 +370,11 @@ void AGOSEngine_Elvira2::oe2_pauseGame() { uint32 pauseTime = getTime(); haltAnimation(); - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; - while (!_quit) { + while (!quit()) { if (processSpecialKeys() != 0 || _lastHitArea3 != 0) break; delay(1); diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index 86088a4385..d07f682937 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -338,7 +338,7 @@ void AGOSEngine_Simon1::os1_pauseGame() { break; } - while (!_quit) { + while (!quit()) { delay(1); if (_keyPressed.keycode == keyYes) quitGame(); diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index 8dc915f6e8..f0da324fbd 100644 --- a/engines/agos/script_ww.cpp +++ b/engines/agos/script_ww.cpp @@ -368,11 +368,11 @@ void AGOSEngine_Waxworks::oww_pauseGame() { uint32 pauseTime = getTime(); haltAnimation(); - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; - while (!_quit) { + while (!quit()) { if (_lastHitArea3 != 0) break; delay(1); diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index c8f6d40f1f..9fd128d764 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -343,7 +343,7 @@ void AGOSEngine::handleVerbClicked(uint verb) { Subroutine *sub; int result; - if (_quit) + if (quit()) return; _objectItem = _hitAreaObjectItem; diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index e1f986b92e..87db49e46b 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -298,11 +298,11 @@ void AGOSEngine::waitWindow(WindowBlock *window) { ha->id = 0x7FFF; ha->priority = 999; - while (!_quit) { + while (!quit()) { _lastHitArea = NULL; _lastHitArea3 = NULL; - for (;;) { + while (!quit()) { if (_lastHitArea3 != 0) break; delay(1); diff --git a/engines/engine.cpp b/engines/engine.cpp index 8f2c1be8eb..e3f53670b5 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -57,9 +57,7 @@ Engine::Engine(OSystem *syst) _targetName(ConfMan.getActiveDomainName()), _gameDataPath(ConfMan.get("path")), _pauseLevel(0), - _mainMenuDialog(NULL), - _quit(false), - _rtl(false) { + _mainMenuDialog(NULL) { g_engine = this; _autosavePeriod = ConfMan.getInt("autosave_period"); diff --git a/engines/engine.h b/engines/engine.h index 278c259ea8..35b85cb7b7 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -51,8 +51,6 @@ public: Audio::Mixer *_mixer; Common::TimerManager * _timer; - bool _quit, _rtl; - protected: Common::EventManager *_eventMan; Common::SaveFileManager *_saveFileMan; diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index e0c18b155f..7b93003791 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -369,7 +369,7 @@ void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) { if (stopComp) _blaster->endComposition(); - while (_blaster->isPlaying() && !_vm->_quit) { + while (_blaster->isPlaying() && !_vm->quit()) { if (interruptible && (_vm->_util->checkKey() == 0x11B)) { WRITE_VAR(57, (uint32) -1); return; -- cgit v1.2.3