aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-03 00:26:34 +0300
committerEugene Sandulenko2013-09-06 14:51:10 +0300
commitda7ef001730b3fdefbf5bdae9a229484c332d4a9 (patch)
treec9b1e5ac21dff3de976420251785961faabb60b7 /engines/fullpipe
parentc78803db2d38afed1cd0a55aff5b599c7441172c (diff)
downloadscummvm-rg350-da7ef001730b3fdefbf5bdae9a229484c332d4a9.tar.gz
scummvm-rg350-da7ef001730b3fdefbf5bdae9a229484c332d4a9.tar.bz2
scummvm-rg350-da7ef001730b3fdefbf5bdae9a229484c332d4a9.zip
FULLPIPE: Implement MessageQueue::sendNextCommand()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/messages.cpp29
-rw-r--r--engines/fullpipe/messages.h3
2 files changed, 31 insertions, 1 deletions
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index e7b317116c..9260da6438 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -98,6 +98,12 @@ bool ExCommand::handleMessage() {
return (cnt > 0);
}
+void ExCommand::sendMessage() {
+ g_fullpipe->_exCommandList.push_back(this);
+
+ processMessages();
+}
+
Message::Message() {
_messageKind = 0;
_parentId = 0;
@@ -240,8 +246,29 @@ void MessageQueue::update() {
}
}
+void MessageQueue::messageQueueCallback1(int par) {
+ warning("STUB: MessageQueue::messageQueueCallback1()");
+}
+
void MessageQueue::sendNextCommand() {
- warning("STUB: MessageQueue::sendNextCommand()");
+ if (_exCommands.size()) {
+ if (!(_flags & 4) && (_flags & 1)) {
+ messageQueueCallback1(16);
+ }
+ ExCommand *ex = (ExCommand *)_exCommands.front();
+ _exCommands.remove_at(0);
+
+ ex->handleMessage();
+ _counter++;
+ ex->_parId = _id;
+ ex->_excFlags |= (ex->_field_24 == 0 ? 1 : 0) | (ex->_field_3C != 0 ? 2 : 0);
+
+ _flags |= 4;
+ ex->sendMessage();
+ } else if (_counter <= 0) {
+ _isFinished = 1;
+ finish();
+ }
}
void MessageQueue::finish() {
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 9a2f0134c9..da91fd2189 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -71,6 +71,7 @@ class ExCommand : public Message {
virtual bool load(MfcArchive &file);
bool handleMessage();
+ void sendMessage();
};
class CObjstateCommand : public CObject {
@@ -114,6 +115,8 @@ class MessageQueue : public CObject {
void update();
void sendNextCommand();
void finish();
+
+ void messageQueueCallback1(int par);
};
class GlobalMessageQueueList : public CPtrList {