aboutsummaryrefslogtreecommitdiff
path: root/sword2/logic.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-03-17 09:03:15 +0000
committerTorbjörn Andersson2004-03-17 09:03:15 +0000
commit4c3a68027f7f84a58664f77c847d24ab5b9757e4 (patch)
treebf20e888b9ea1cc2045df84aad12ef1cd54ec7de /sword2/logic.h
parent03200025dfb030d887ff9b07d180a8f9e2f225bc (diff)
downloadscummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.gz
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.tar.bz2
scummvm-rg350-4c3a68027f7f84a58664f77c847d24ab5b9757e4.zip
Use the same syntax for accessing script variables as BS1 does, i.e. now
it's Logic::_scriptVars[ID] instead of just ID. Apart from looking cool, it makes it much easier to tell the difference between variables and constants when looking at the code. Of course, this sort of sweeping changes is jolly good for introducing truly weird regressions, which is why I waited until after 0.6.0. svn-id: r13331
Diffstat (limited to 'sword2/logic.h')
-rw-r--r--sword2/logic.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/sword2/logic.h b/sword2/logic.h
index fc44ce8ac8..ebb8368b03 100644
--- a/sword2/logic.h
+++ b/sword2/logic.h
@@ -30,14 +30,12 @@
namespace Sword2 {
-#define STACK_SIZE 10
-
-#define MAX_events 10
+#define MAX_events 10
// There won't be many, will there? Probably 2 at most i reckon
-#define MAX_syncs 10
+#define MAX_syncs 10
-#define TREE_SIZE 3
+#define TREE_SIZE 3
// This must allow for the largest number of objects in a screen
#define OBJECT_KILL_LIST_SIZE 50
@@ -50,9 +48,6 @@ class Logic {
private:
Sword2Engine *_vm;
- // Point to the global variable data
- int32 *_globals;
-
uint32 _objectKillList[OBJECT_KILL_LIST_SIZE];
// keeps note of no. of objects in the kill list
@@ -162,13 +157,14 @@ private:
public:
Logic(Sword2Engine *vm) :
- _vm(vm), _globals(NULL), _kills(0), _debugFlag(false),
- _smackerLeadOut(0), _sequenceTextLines(0), _speechTime(0),
- _animId(0), _speechAnimType(0), _leftClickDelay(0),
- _rightClickDelay(0), _defaultResponseId(0),
- _totalStartups(0), _totalScreenManagers(0),
- _officialTextNumber(0), _speechScriptWaiting(0),
- _speechTextBlocNo(0), _choosing(false), _unpauseZone(0) {
+ _vm(vm), _kills(0), _debugFlag(false), _smackerLeadOut(0),
+ _sequenceTextLines(0), _speechTime(0), _animId(0),
+ _speechAnimType(0), _leftClickDelay(0), _rightClickDelay(0),
+ _defaultResponseId(0), _totalStartups(0),
+ _totalScreenManagers(0), _officialTextNumber(0),
+ _speechScriptWaiting(0), _speechTextBlocNo(0),
+ _choosing(false), _unpauseZone(0) {
+ _scriptVars = NULL;
memset(_subjectList, 0, sizeof(_subjectList));
memset(_eventList, 0, sizeof(_eventList));
memset(_syncList, 0, sizeof(_syncList));
@@ -180,6 +176,9 @@ public:
delete _router;
}
+ // Point to the global variable data
+ static uint32 *_scriptVars;
+
// "TEXT" - current official text line number - will match the wav
// filenames
@@ -200,10 +199,11 @@ public:
uint32 _unpauseZone;
+ void resetScriptVars(void);
+
void conPrintStartMenu(void);
void conStart(int start);
- void setGlobalInterpreterVariables(int32 *vars);
int runScript(char *scriptData, char *objectData, uint32 *offset);
struct EventUnit {