diff options
author | Eugene Sandulenko | 2014-04-11 23:18:31 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-11 23:18:31 +0300 |
commit | af06053d6bace6546cd9d500957eff8cf58b7a89 (patch) | |
tree | 3d2c062a5df728fbefdb728acc7d41abc00c4027 /engines | |
parent | b4d06ccfe0dde0d9399616a7c67d7bfea196e43f (diff) | |
download | scummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.tar.gz scummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.tar.bz2 scummvm-rg350-af06053d6bace6546cd9d500957eff8cf58b7a89.zip |
FULLPIPE: Implement StaticANIObject::startMQIfIdle()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/statics.cpp | 30 |
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() { |