aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2007-03-24 19:55:34 +0000
committerNicola Mettifogo2007-03-24 19:55:34 +0000
commit3034cb127329da8de756cee5a48e927206e396fb (patch)
treebf43d84811dc9df5947dec9152b5a412e280ca26 /engines/parallaction
parentafe981d3403034e1714875ef5b77502f8ec9885d (diff)
downloadscummvm-rg350-3034cb127329da8de756cee5a48e927206e396fb.tar.gz
scummvm-rg350-3034cb127329da8de756cee5a48e927206e396fb.tar.bz2
scummvm-rg350-3034cb127329da8de756cee5a48e927206e396fb.zip
made more functions members of Parallaction
svn-id: r26294
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/animation.cpp4
-rw-r--r--engines/parallaction/commands.cpp6
-rw-r--r--engines/parallaction/dialogue.cpp4
-rw-r--r--engines/parallaction/parallaction.h14
-rw-r--r--engines/parallaction/walk.cpp6
-rw-r--r--engines/parallaction/zone.cpp5
-rw-r--r--engines/parallaction/zone.h8
7 files changed, 24 insertions, 23 deletions
diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp
index b14b3685c5..166fdfaf79 100644
--- a/engines/parallaction/animation.cpp
+++ b/engines/parallaction/animation.cpp
@@ -152,7 +152,7 @@ Animation *Parallaction::parseAnimation(Script& script, Node *list, char *name)
-void freeScript(Program *program) {
+void Parallaction::freeScript(Program *program) {
if (!program) return;
@@ -587,7 +587,7 @@ void jobRunScripts(void *parm, Job *j) {
case INST_END: // exit
if ((a->_flags & kFlagsLooping) == 0) {
a->_flags &= ~kFlagsActing;
- runCommands(a->_commands, a);
+ _vm->runCommands(a->_commands, a);
}
a->_program->_ip = (Instruction*)a->_program->_next;
goto label1;
diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp
index a0c5972633..cac2983254 100644
--- a/engines/parallaction/commands.cpp
+++ b/engines/parallaction/commands.cpp
@@ -46,7 +46,7 @@ namespace Parallaction {
#define CMD_STOP 16
-Command *parseCommands(Script &script) {
+Command *Parallaction::parseCommands(Script &script) {
// printf("parseCommands()");
Node root;
@@ -193,7 +193,7 @@ Command *parseCommands(Script &script) {
}
-void freeCommands(Command *list) {
+void Parallaction::freeCommands(Command *list) {
Command *cmd = list;
@@ -211,7 +211,7 @@ void freeCommands(Command *list) {
-void runCommands(Command *list, Zone *z) {
+void Parallaction::runCommands(Command *list, Zone *z) {
debugC(1, kDebugLocation, "runCommands");
Command *cmd = list;
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 756907472f..d4576f60f6 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -196,7 +196,7 @@ char *Parallaction::parseDialogueString(Script &script) {
}
-void freeDialogue(Dialogue *d) {
+void Parallaction::freeDialogue(Dialogue *d) {
if (!d) return;
@@ -368,7 +368,7 @@ uint16 getDialogueAnswer(Dialogue *q, Cnv *cnv) {
return answer;
}
-void runDialogue(SpeakData *data) {
+void Parallaction::runDialogue(SpeakData *data) {
debugC(1, kDebugDialogue, "runDialogue: starting dialogue '%s'", data->_name);
enterDialogue();
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 060f942ab1..665a389013 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -158,11 +158,7 @@ void addNode(Node *list, Node *n);
void removeNode(Node *n);
void freeNodeList(Node *list);
-Command *parseCommands(Script &script);
-void runCommands(Command *list, Zone *z = NULL);
-void freeCommands(Command*);
-void runDialogue(SpeakData*);
void jobRemovePickedItem(void*, Job *j);
void jobDisplayDroppedItem(void*, Job *j);
@@ -313,6 +309,11 @@ public:
void sortAnimations();
void freeLocation();
+ uint16 runZone(Zone*);
+ void runDialogue(SpeakData*);
+ void freeDialogue(Dialogue *d);
+ void runCommands(Command *list, Zone *z = NULL);
+
public:
int getGameType() const;
uint32 getFeatures() const;
@@ -413,6 +414,11 @@ protected: // members
void pickMusic(const char *location);
void selectCharacterMusic(const char *name);
+ void freeScript(Program*);
+
+ Command *parseCommands(Script &script);
+ void freeCommands(Command*);
+
};
// FIXME: remove global
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 05607a505b..130fa57e78 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -402,7 +402,7 @@ uint16 checkDoor() {
_zoneTrap = NULL;
} else {
- runCommands(z->_commands, z);
+ _vm->runCommands(z->_commands, z);
}
}
@@ -410,13 +410,13 @@ uint16 checkDoor() {
if (z != NULL) {
_localFlags[_vm->_currentLocationIndex] |= kFlagsEnter;
- runCommands(z->_commands, z);
+ _vm->runCommands(z->_commands, z);
_localFlags[_vm->_currentLocationIndex] &= ~kFlagsEnter;
_zoneTrap = z;
} else
if (_zoneTrap != NULL) {
_localFlags[_vm->_currentLocationIndex] |= kFlagsExit;
- runCommands(_zoneTrap->_commands, _zoneTrap);
+ _vm->runCommands(_zoneTrap->_commands, _zoneTrap);
_localFlags[_vm->_currentLocationIndex] &= ~kFlagsExit;
_zoneTrap = NULL;
}
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index 48e01d8af7..19ac4f80e5 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -29,9 +29,8 @@
namespace Parallaction {
-void freeScript(Program*);
-void freeDialogue(Dialogue *d);
+
Zone *Parallaction::findZone(const char *name) {
@@ -418,7 +417,7 @@ void displayItemComment(ExamineData *data) {
-uint16 runZone(Zone *z) {
+uint16 Parallaction::runZone(Zone *z) {
debugC(3, kDebugLocation, "runZone (%s)", z->_label._text);
uint16 subtype = z->_type & 0xFFFF;
diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h
index 13794cf243..8d61dedf9e 100644
--- a/engines/parallaction/zone.h
+++ b/engines/parallaction/zone.h
@@ -204,7 +204,7 @@ struct Zone : public Node {
_flags = 0;
_commands = NULL;
}
-
+
virtual ~Zone() {}
void getRect(Common::Rect& r) const {
@@ -316,7 +316,7 @@ struct Animation : public Zone {
_frame = 0;
_z = 0;
}
-
+
virtual ~Animation() {}
virtual uint16 width() const {
@@ -341,14 +341,10 @@ struct Animation : public Zone {
};
-uint16 runZone(Zone *z);
void dropItem(uint16 v);
int16 pickupItem(Zone *z);
-uint16 checkDoor();
-
-
void loadProgram(Animation *, char *filename);