diff options
Diffstat (limited to 'engines/agos')
-rw-r--r-- | engines/agos/animation.cpp | 4 | ||||
-rw-r--r-- | engines/agos/input.cpp | 4 | ||||
-rw-r--r-- | engines/agos/midi.cpp | 6 | ||||
-rw-r--r-- | engines/agos/oracle.cpp | 2 | ||||
-rw-r--r-- | engines/agos/saveload.cpp | 20 | ||||
-rw-r--r-- | engines/agos/script.cpp | 2 | ||||
-rw-r--r-- | engines/agos/script_e1.cpp | 8 | ||||
-rw-r--r-- | engines/agos/script_e2.cpp | 4 | ||||
-rw-r--r-- | engines/agos/script_s1.cpp | 12 | ||||
-rw-r--r-- | engines/agos/script_ww.cpp | 4 | ||||
-rw-r--r-- | engines/agos/verb.cpp | 3 | ||||
-rw-r--r-- | engines/agos/window.cpp | 2 |
12 files changed, 36 insertions, 35 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index c92f834a3b..3e1b9b0611 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -151,7 +151,7 @@ void MoviePlayer::play() { startSound(); - while (_frameNum < _framesCount) + while (_frameNum < _framesCount && !_vm->_quit) handleNextFrame(); closeFile(); @@ -167,7 +167,7 @@ void MoviePlayer::play() { _vm->_system->setPalette(palette, 0, 256); } - _vm->fillBackGroundFromBack(); + _vm->fillBackGroundFromBack(); _vm->_fastFadeOutFlag = true; } diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index d36549f187..6f4cd09947 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -123,7 +123,7 @@ void AGOSEngine::setup_cond_c_helper() { clearName(); _lastNameOn = last; - for (;;) { + 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); + } while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !_quit); if (_lastHitArea == NULL) { } else if (_lastHitArea->id == 0x7FFB) { diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 3114b24549..891e9bde95 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -538,7 +538,11 @@ void MidiPlayer::loadXMIDI(Common::File *in, bool sfx) { error("Expected 'FORM' tag but found '%c%c%c%c' instead", buf[0], buf[1], buf[2], buf[3]); } - MidiParser *parser = MidiParser::createParser_XMIDI(); + // In the DOS version of Simon the Sorcerer 2, the music contains lots + // of XMIDI callback controller events. As far as we know, they aren't + // actually used, so we disable the callback handler explicitly. + + MidiParser *parser = MidiParser::createParser_XMIDI(NULL); parser->setMidiDriver(this); parser->setTimerRate(_driver->getBaseTempo()); if (!parser->loadMusic(p->data, size)) diff --git a/engines/agos/oracle.cpp b/engines/agos/oracle.cpp index a113c8e2ea..2d2feb7b9e 100644 --- a/engines/agos/oracle.cpp +++ b/engines/agos/oracle.cpp @@ -459,7 +459,7 @@ void AGOSEngine_Feeble::saveUserGame(int slot) { } windowPutChar(window, 0x7f); - for (;;) { + while (!_quit) { _keyPressed.reset(); delay(1); diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index 4a5c43e706..9779630d47 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -279,11 +279,11 @@ restart: name = buf; _saveGameNameLen = 0; - for (;;) { + while (!_quit) { windowPutChar(window, 128); _keyPressed.reset(); - for (;;) { + 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; - for (;;) { + while (!_quit) { windowPutChar(window, 128); _saveLoadEdit = true; @@ -516,7 +516,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) { _keyPressed.reset(); - for (;;) { + 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); + } while (_lastHitArea3 == 0 && !_quit); ha = _lastHitArea; if (ha == NULL || ha->id < 200) { @@ -543,6 +543,8 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) { return ha->id - 200; } } + + return 225; } void AGOSEngine_Simon1::listSaveGames(char *dst) { @@ -706,7 +708,7 @@ restart:; _saveGameNameLen++; } - for (;;) { + while (!_quit) { windowPutChar(window, 127); _saveLoadEdit = true; @@ -785,7 +787,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) { _keyPressed.reset(); - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; @@ -795,7 +797,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) { return _keyPressed.ascii; } delay(10); - } while (_lastHitArea3 == 0); + } while (_lastHitArea3 == 0 && !_quit); ha = _lastHitArea; if (ha == NULL || ha->id < 205) { @@ -824,6 +826,8 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) { return ha->id - 208; } } + + return 205; } void AGOSEngine::disableFileBoxes() { diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 6758aec511..fa132ec26f 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 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 c7e1d6736e..9b572e347b 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -1053,11 +1053,11 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) { ha->priority = 999; ha->window = 0; - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; - for (;;) { + while (!_quit) { if (_lastHitArea3 != 0) break; delay(1); @@ -1102,11 +1102,11 @@ uint AGOSEngine::continueOrQuit() { ha->priority = 999; ha->window = 0; - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; - for (;;) { + while (!_quit) { if (_lastHitArea3 != 0) break; delay(1); diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index da9afc5a7d..6f6db8efb4 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(); - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; - for (;;) { + 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 51918b9515..6183a3fb20 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -339,18 +339,8 @@ void AGOSEngine_Simon1::os1_pauseGame() { break; } - for (;;) { + while (!_quit) { delay(1); -#ifdef _WIN32_WCE - if (isSmartphone()) { - if (_keyPressed.keycode) { - if (_keyPressed.keycode == Common::KEYCODE_RETURN) - _quit = true; - else - break; - } - } -#endif if (_keyPressed.keycode == keyYes) _quit = true; else if (_keyPressed.keycode == keyNo) diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index 5fd83312c3..8dc915f6e8 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(); - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; - for (;;) { + while (!_quit) { if (_lastHitArea3 != 0) break; delay(1); diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index 963bd6bd86..c8f6d40f1f 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -343,6 +343,9 @@ void AGOSEngine::handleVerbClicked(uint verb) { Subroutine *sub; int result; + if (_quit) + return; + _objectItem = _hitAreaObjectItem; if (_objectItem == _dummyItem2) { _objectItem = me(); diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index e25bd6b438..e1f986b92e 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -298,7 +298,7 @@ void AGOSEngine::waitWindow(WindowBlock *window) { ha->id = 0x7FFF; ha->priority = 999; - for (;;) { + while (!_quit) { _lastHitArea = NULL; _lastHitArea3 = NULL; |