aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-02 02:04:03 +0300
committerEugene Sandulenko2013-09-06 14:51:09 +0300
commitc78803db2d38afed1cd0a55aff5b599c7441172c (patch)
tree05719b209aa0db85b580ef87b47e5a2370d20d09
parent9232315880633e66f99e874623446664ca262719 (diff)
downloadscummvm-rg350-c78803db2d38afed1cd0a55aff5b599c7441172c.tar.gz
scummvm-rg350-c78803db2d38afed1cd0a55aff5b599c7441172c.tar.bz2
scummvm-rg350-c78803db2d38afed1cd0a55aff5b599c7441172c.zip
FULLPIPE: Unstubbed ExCommand::handleMessage()
-rw-r--r--engines/fullpipe/behavior.cpp2
-rw-r--r--engines/fullpipe/messages.cpp38
-rw-r--r--engines/fullpipe/messages.h5
3 files changed, 41 insertions, 4 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index e9d4be8207..e7d1bc9858 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -33,7 +33,7 @@ BehaviorManager::BehaviorManager() {
}
void BehaviorManager::initBehavior(Scene *scene, CGameVar *var) {
- warning("STUB: initBehavior()");
+ warning("STUB: BehaviorManager::initBehavior()");
}
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index ee9210f066..e7b317116c 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -79,8 +79,23 @@ bool ExCommand::load(MfcArchive &file) {
return true;
}
-void ExCommand::handleMessage() {
- warning("STUB: ExCommand::handleMessage()");
+bool ExCommand::handleMessage() {
+ int cnt = 0;
+ for (MessageHandler *m = g_fullpipe->_messageHandlers; m; m = m->nextItem)
+ cnt += m->callback(this);
+
+ if (_messageKind == 17 || (_excFlags & 1)) {
+ if (_parId) {
+ MessageQueue *m = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_parId);
+ if (m)
+ m->update();
+ }
+ }
+
+ if (_excFlags & 2)
+ delete this;
+
+ return (cnt > 0);
}
Message::Message() {
@@ -213,6 +228,25 @@ bool MessageQueue::chain(StaticANIObject *ani) {
return true;
}
+void MessageQueue::update() {
+ if (_counter > 0)
+ _counter--;
+
+ if (_exCommands.size()) {
+ sendNextCommand();
+ } else if (_counter == 0 ) {
+ _isFinished = 1;
+ finish();
+ }
+}
+
+void MessageQueue::sendNextCommand() {
+ warning("STUB: MessageQueue::sendNextCommand()");
+}
+
+void MessageQueue::finish() {
+ warning("STUB: MessageQueue::finish()");
+}
MessageQueue *GlobalMessageQueueList::getMessageQueueById(int id) {
for (CPtrList::iterator s = begin(); s != end(); ++s) {
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 0ae11ff244..9a2f0134c9 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -70,7 +70,7 @@ class ExCommand : public Message {
virtual bool load(MfcArchive &file);
- void handleMessage();
+ bool handleMessage();
};
class CObjstateCommand : public CObject {
@@ -111,6 +111,9 @@ class MessageQueue : public CObject {
void setFlags(int flags) { _flags = flags; }
bool chain(StaticANIObject *ani);
+ void update();
+ void sendNextCommand();
+ void finish();
};
class GlobalMessageQueueList : public CPtrList {