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
This commit is contained in:
Christopher Page 2008-08-13 20:45:00 +00:00
parent 2d31207a81
commit 8d8c46e36f
14 changed files with 27 additions and 31 deletions

View File

@ -150,7 +150,7 @@ void MoviePlayer::play() {
startSound();
while (_frameNum < _framesCount && !_vm->_quit)
while (_frameNum < _framesCount && !_vm->quit())
handleNextFrame();
closeFile();

View File

@ -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) {

View File

@ -459,7 +459,7 @@ void AGOSEngine_Feeble::saveUserGame(int slot) {
}
windowPutChar(window, 0x7f);
while (!_quit) {
while (!quit()) {
_keyPressed.reset();
delay(1);

View File

@ -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) {

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -338,7 +338,7 @@ void AGOSEngine_Simon1::os1_pauseGame() {
break;
}
while (!_quit) {
while (!quit()) {
delay(1);
if (_keyPressed.keycode == keyYes)
quitGame();

View File

@ -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);

View File

@ -343,7 +343,7 @@ void AGOSEngine::handleVerbClicked(uint verb) {
Subroutine *sub;
int result;
if (_quit)
if (quit())
return;
_objectItem = _hitAreaObjectItem;

View File

@ -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);

View File

@ -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");

View File

@ -51,8 +51,6 @@ public:
Audio::Mixer *_mixer;
Common::TimerManager * _timer;
bool _quit, _rtl;
protected:
Common::EventManager *_eventMan;
Common::SaveFileManager *_saveFileMan;

View File

@ -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;