aboutsummaryrefslogtreecommitdiff
path: root/sword2/logic.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-10-22 06:51:57 +0000
committerTorbjörn Andersson2003-10-22 06:51:57 +0000
commit59b72f2b382de8dbcc782712b42a832fe2c91e27 (patch)
tree2e5666af8b8f2b843d9af93c5cbbc95c218d2fe1 /sword2/logic.h
parentd269b06ba6c9fc9be797bf67313758b8f945baaa (diff)
downloadscummvm-rg350-59b72f2b382de8dbcc782712b42a832fe2c91e27.tar.gz
scummvm-rg350-59b72f2b382de8dbcc782712b42a832fe2c91e27.tar.bz2
scummvm-rg350-59b72f2b382de8dbcc782712b42a832fe2c91e27.zip
Moved a few remaining pieces of the script interpreter into the Logic class
svn-id: r10939
Diffstat (limited to 'sword2/logic.h')
-rw-r--r--sword2/logic.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/sword2/logic.h b/sword2/logic.h
index a1c2e4d718..e54d520794 100644
--- a/sword2/logic.h
+++ b/sword2/logic.h
@@ -22,16 +22,28 @@
#ifndef _LOGIC
#define _LOGIC
-#include "bs2/defs.h"
+// #include "bs2/defs.h"
#include "bs2/header.h"
namespace Sword2 {
#define TREE_SIZE 3
+// This must allow for the largest number of objects in a screen
+#define OBJECT_KILL_LIST_SIZE 50
+
class Logic {
private:
- void setupOpcodes(void);
+ // Point to the global variable data
+ int32 *_globals;
+
+ uint32 _objectKillList[OBJECT_KILL_LIST_SIZE];
+
+ // keeps note of no. of objects in the kill list
+ uint32 _kills;
+
+ // Set this to turn debugging on
+ bool _debugFlag;
// FIXME: Some opcodes pass pointers in integer variables. I don't
// think that's entirely portable.
@@ -48,16 +60,17 @@ private:
// denotes the res id of the game-object-list in current use
uint32 _currentRunList;
- void processKillList(void);
-
//pc during logic loop
uint32 _pc;
// each object has one of these tacked onto the beginning
_object_hub *_curObjectHub;
+ void setupOpcodes(void);
+ void processKillList(void);
+
public:
- Logic() {
+ Logic() : _globals(NULL), _kills(0), _debugFlag(false) {
setupOpcodes();
}