aboutsummaryrefslogtreecommitdiff
path: root/sword2/interpreter.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-11-16 14:18:29 +0000
committerTorbjörn Andersson2003-11-16 14:18:29 +0000
commitfa2b8ba8de31f5659c675b507553a2b0a1ebd841 (patch)
tree52841e821b3283a0ff9430cf8be0cc273208f6e6 /sword2/interpreter.cpp
parentab066c41e0a42320137bc6cb79d77720f932af0e (diff)
downloadscummvm-rg350-fa2b8ba8de31f5659c675b507553a2b0a1ebd841.tar.gz
scummvm-rg350-fa2b8ba8de31f5659c675b507553a2b0a1ebd841.tar.bz2
scummvm-rg350-fa2b8ba8de31f5659c675b507553a2b0a1ebd841.zip
More cleanup. I've eliminated all the temporary global variables I've added
over the past few weeks, except for g_sword2. (Of course, this doesn't necessarily make the code any prettier, but we can work on that later.) svn-id: r11309
Diffstat (limited to 'sword2/interpreter.cpp')
-rw-r--r--sword2/interpreter.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/sword2/interpreter.cpp b/sword2/interpreter.cpp
index c35e6eb954..d8550c9fe8 100644
--- a/sword2/interpreter.cpp
+++ b/sword2/interpreter.cpp
@@ -17,11 +17,9 @@
* $Header$
*/
-#include "stdafx.h"
-#include "sword2/driver/driver96.h"
-#include "sword2/console.h"
+#include "common/stdafx.h"
+#include "sword2/sword2.h"
#include "sword2/interpreter.h"
-#include "sword2/logic.h"
namespace Sword2 {
@@ -353,8 +351,8 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) {
case CP_PUSH_LOCAL_ADDR:
// push the address of a local variable
Read16ip(parameter);
- debug(5, "Push address of local variable %d (%x)", parameter, memory->ptrToInt((const uint8 *) (variables + parameter)));
- PUSHONSTACK(memory->ptrToInt((uint8 *) (variables + parameter)));
+ debug(5, "Push address of local variable %d (%x)", parameter, _vm->_memory->ptrToInt((const uint8 *) (variables + parameter)));
+ PUSHONSTACK(_vm->_memory->ptrToInt((uint8 *) (variables + parameter)));
break;
case CP_PUSH_INT32:
// Push a long word value on to the stack
@@ -589,14 +587,14 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) {
Read8ip(parameter);
// ip points to the string
- PUSHONSTACK(memory->ptrToInt((const uint8 *) (code + ip)));
+ PUSHONSTACK(_vm->_memory->ptrToInt((const uint8 *) (code + ip)));
ip += (parameter + 1);
break;
case CP_PUSH_DEREFERENCED_STRUCTURE:
// Push the address of a dereferenced structure
Read32ip(parameter);
- debug(5, "Push address of far variable (%x)", memory->ptrToInt((const uint8 *) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter)));
- PUSHONSTACK(memory->ptrToInt((const uint8 *) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter)));
+ debug(5, "Push address of far variable (%x)", _vm->_memory->ptrToInt((const uint8 *) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter)));
+ PUSHONSTACK(_vm->_memory->ptrToInt((const uint8 *) (objectData + sizeof(int32) + sizeof(_standardHeader) + sizeof(_object_hub) + parameter)));
break;
case OP_GTTHANE:
// '>='