aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/statics.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-11 23:18:31 +0300
committerEugene Sandulenko2014-04-11 23:18:31 +0300
commitaf06053d6bace6546cd9d500957eff8cf58b7a89 (patch)
tree3d2c062a5df728fbefdb728acc7d41abc00c4027 /engines/fullpipe/statics.cpp
parentb4d06ccfe0dde0d9399616a7c67d7bfea196e43f (diff)
downloadscummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.tar.gz
scummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.tar.bz2
scummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.zip
FULLPIPE: Implement StaticANIObject::startMQIfIdle()
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r--engines/fullpipe/statics.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 75c1c7d1ea..25979efed2 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -330,7 +330,35 @@ bool StaticANIObject::trySetMessageQueue(int msgNum, int qId) {
}
void StaticANIObject::startMQIfIdle(int qId, int flag) {
- warning("STUB: StaticANIObject::startMQIfIdle()");
+ MessageQueue *msg = g_fp->_currentScene->getMessageQueueById(qId);
+
+ if (msg && isIdle() && !(_flags & 0x100)) {
+ MessageQueue *mq = new MessageQueue(msg, 0, 0);
+
+ mq->setFlags(mq->getFlags() | flag);
+
+ ExCommand *ex = mq->getExCommandByIndex(0);
+
+ if (ex) {
+ while (ex->_messageKind != 1 || ex->_parentId != _id) {
+ ex->_parId = 0;
+ ex->_excFlags |= 2;
+ ex->handleMessage();
+
+ mq->deleteExCommandByIndex(0, 0);
+
+ ex = mq->getExCommandByIndex(0);
+
+ if (!ex)
+ return;
+ }
+
+ if (ex) {
+ startAnim(ex->_messageNum, mq->_id, -1);
+ mq->deleteExCommandByIndex(0, 1);
+ }
+ }
+ }
}
bool StaticANIObject::isIdle() {