diff options
author | Christopher Page | 2008-05-20 21:40:53 +0000 |
---|---|---|
committer | Christopher Page | 2008-05-20 21:40:53 +0000 |
commit | ca76ef4e1fa2fc9ebe0daaa2b3b6e61bed87ea14 (patch) | |
tree | d78808dec0a17a7316781926ac761d5055a51533 /engines/agos/script.cpp | |
parent | 5e592d4e4aa7eb9929a9bbf1283a0382d890de84 (diff) | |
download | scummvm-rg350-ca76ef4e1fa2fc9ebe0daaa2b3b6e61bed87ea14.tar.gz scummvm-rg350-ca76ef4e1fa2fc9ebe0daaa2b3b6e61bed87ea14.tar.bz2 scummvm-rg350-ca76ef4e1fa2fc9ebe0daaa2b3b6e61bed87ea14.zip |
AGOS Engine: Began implementation for a new quit event which will cleanly return to the launcher. This replaces the old shutdown() method within delay()
svn-id: r32203
Diffstat (limited to 'engines/agos/script.cpp')
-rw-r--r-- | engines/agos/script.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 44fbb4e9e0..6758aec511 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -410,7 +410,7 @@ void AGOSEngine::o_msg() { void AGOSEngine::o_end() { // 68: exit interpreter - shutdown(); + _quit = true; } void AGOSEngine::o_done() { @@ -965,6 +965,9 @@ void AGOSEngine::writeVariable(uint16 variable, uint16 contents) { int AGOSEngine::runScript() { bool flag; + if (_quit) + return 1; + do { if (_continousMainScript) dumpOpcode(_codePtr); @@ -1007,7 +1010,7 @@ int AGOSEngine::runScript() { error("Invalid opcode '%d' encountered", _opcode); executeOpcode(_opcode); - } while (getScriptCondition() != flag && !getScriptReturn()); + } while (getScriptCondition() != flag && !getScriptReturn() && !_quit); return getScriptReturn(); } @@ -1063,7 +1066,7 @@ void AGOSEngine::waitForSync(uint a) { _exitCutscene = false; _rightButtonDown = false; - while (_vgaWaitFor != 0) { + while (_vgaWaitFor != 0 && !_quit) { if (_rightButtonDown) { if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) { skipSpeech(); |