aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-09-09 10:47:32 +0000
committerTorbjörn Andersson2006-09-09 10:47:32 +0000
commitc51d6bb903e210ae485f6844b829112c0d4b371a (patch)
tree48b13d2995f76040ad370cbbae45d4571eea3ee9 /engines
parent8116f167adf8376a3bf6c37cc6ea337790a03ae3 (diff)
downloadscummvm-rg350-c51d6bb903e210ae485f6844b829112c0d4b371a.tar.gz
scummvm-rg350-c51d6bb903e210ae485f6844b829112c0d4b371a.tar.bz2
scummvm-rg350-c51d6bb903e210ae485f6844b829112c0d4b371a.zip
Fixed compilation.
svn-id: r23842
Diffstat (limited to 'engines')
-rw-r--r--engines/sword2/interpreter.cpp5
-rw-r--r--engines/sword2/logic.h1
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp
index 90bdea38ff..c496d2bafe 100644
--- a/engines/sword2/interpreter.cpp
+++ b/engines/sword2/interpreter.cpp
@@ -193,7 +193,8 @@ void Logic::setupOpcodes() {
OPCODE(fnRefreshInventory),
OPCODE(fnChangeShadows)
};
-
+
+ _numOpcodes = ARRAYSIZE(opcodes);
_opcodes = opcodes;
}
@@ -609,7 +610,7 @@ int Logic::runScript2(byte *scriptData, byte *objectData, byte *offsetPtr) {
case CP_CALL_MCODE:
// Call an mcode routine
Read16ip(parameter);
- assert(parameter < ARRAYSIZE(opcodes));
+ assert(parameter < _numOpcodes);
// amount to adjust stack by (no of parameters)
Read8ip(value);
debug(9, "CP_CALL_MCODE: '%s', %d", _opcodes[parameter].desc, value);
diff --git a/engines/sword2/logic.h b/engines/sword2/logic.h
index cc928858d6..e68d9c9317 100644
--- a/engines/sword2/logic.h
+++ b/engines/sword2/logic.h
@@ -184,6 +184,7 @@ public:
const char *desc;
};
const OpcodeEntry *_opcodes;
+ int _numOpcodes;
void setupOpcodes();
int32 fnTestFunction(int32 *params);