aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2007-04-06 18:29:55 +0000
committerNicola Mettifogo2007-04-06 18:29:55 +0000
commit40245fe4504ecc7cb26ccfc5b5c7d5d2b15cbbe7 (patch)
tree0d9ea3fb6bd4f9d44572458513e88769b64c62bc /engines/parallaction
parentf069c5e8fff3e52e94cb0bda0ad7eb1218e271c1 (diff)
downloadscummvm-rg350-40245fe4504ecc7cb26ccfc5b5c7d5d2b15cbbe7.tar.gz
scummvm-rg350-40245fe4504ecc7cb26ccfc5b5c7d5d2b15cbbe7.tar.bz2
scummvm-rg350-40245fe4504ecc7cb26ccfc5b5c7d5d2b15cbbe7.zip
Made Program hold an explicit reference to its set of Instruction(s) instead of simply being a Node chained with them.
svn-id: r26393
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/animation.cpp8
-rw-r--r--engines/parallaction/zone.h3
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp
index b74ce0bebd..7102aa8136 100644
--- a/engines/parallaction/animation.cpp
+++ b/engines/parallaction/animation.cpp
@@ -157,7 +157,7 @@ void Parallaction::freeScript(Program *program) {
if (!program) return;
delete[] program->_locals;
- freeNodeList(program);
+ freeNodeList(&program->_start);
return;
}
@@ -261,7 +261,7 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
a->_program = new Program;
a->_program->_locals = new LocalVariable[10];
- Node *vD0 = a->_program;
+ Node *vD0 = &a->_program->_start;
Instruction *vCC = new Instruction;
@@ -280,7 +280,7 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
delete script;
- a->_program->_ip = (Instruction*)a->_program->_next;
+ a->_program->_ip = (Instruction*)a->_program->_start._next;
return;
}
@@ -588,7 +588,7 @@ void jobRunScripts(void *parm, Job *j) {
a->_flags &= ~kFlagsActing;
_vm->runCommands(a->_commands, a);
}
- a->_program->_ip = (Instruction*)a->_program->_next;
+ a->_program->_ip = (Instruction*)a->_program->_start._next;
goto label1;
diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h
index 8d61dedf9e..8d33963951 100644
--- a/engines/parallaction/zone.h
+++ b/engines/parallaction/zone.h
@@ -279,11 +279,12 @@ struct Instruction : public Node {
};
-struct Program : public Node {
+struct Program {
LocalVariable *_locals;
uint16 _loopCounter;
Instruction *_ip;
Instruction *_loopStart;
+ Instruction _start;
Program() {
_locals = NULL;