From c78803db2d38afed1cd0a55aff5b599c7441172c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 2 Aug 2013 02:04:03 +0300 Subject: FULLPIPE: Unstubbed ExCommand::handleMessage() --- engines/fullpipe/behavior.cpp | 2 +- engines/fullpipe/messages.cpp | 38 ++++++++++++++++++++++++++++++++++++-- engines/fullpipe/messages.h | 5 ++++- 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 { -- cgit v1.2.3