aboutsummaryrefslogtreecommitdiff
path: root/engines/made/script.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-04 09:31:37 +0000
committerFilippos Karapetis2009-10-04 09:31:37 +0000
commitdecdc5771a6c4733ab4a1276fc60c2454c8340a6 (patch)
treee07fb4c33053c840447cac524fb8e45cb0d77fda /engines/made/script.cpp
parent1ed6a2668be5462694c81369cc5abb89e199e2dc (diff)
downloadscummvm-rg350-decdc5771a6c4733ab4a1276fc60c2454c8340a6.tar.gz
scummvm-rg350-decdc5771a6c4733ab4a1276fc60c2454c8340a6.tar.bz2
scummvm-rg350-decdc5771a6c4733ab4a1276fc60c2454c8340a6.zip
Applied patch #2872409 "MADE engine fixes" by agent-q, with one small modification (initialized _soundStarted in the ScriptFunctions constructor)
svn-id: r44589
Diffstat (limited to 'engines/made/script.cpp')
-rw-r--r--engines/made/script.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/made/script.cpp b/engines/made/script.cpp
index 4c3bff77c3..91b932cc92 100644
--- a/engines/made/script.cpp
+++ b/engines/made/script.cpp
@@ -32,10 +32,12 @@
#include "made/scriptfuncs.h"
#include "made/screen.h"
+
namespace Made {
/* ScriptInterpreter */
+
ScriptInterpreter::ScriptInterpreter(MadeEngine *vm) : _vm(vm) {
#ifdef DUMP_SCRIPTS
#define COMMAND(x, sig) { &ScriptInterpreter::x, #x, sig }
@@ -143,7 +145,7 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase;
- while (!_vm->shouldQuit()) {
+ while (true) {
byte opcode = readByte();
if (opcode >= 1 && opcode <= _commandsMax) {
@@ -158,6 +160,9 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
if (++opcodeSleepCounter > 500) {
_vm->_screen->updateScreenAndWait(5);
opcodeSleepCounter = 0;
+ if (_vm->shouldQuit()) {
+ break;
+ }
}
}