diff options
author | Eugene Sandulenko | 2014-04-25 22:30:10 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-25 22:30:10 +0300 |
commit | 58648b08948129aafa9c678a18834052254f5b11 (patch) | |
tree | 6315a838992299191e8ef13cc0d51adb0191961f | |
parent | 8230577153fb15ee588ca3b7e0d43b1e13e49eaa (diff) | |
download | scummvm-rg350-58648b08948129aafa9c678a18834052254f5b11.tar.gz scummvm-rg350-58648b08948129aafa9c678a18834052254f5b11.tar.bz2 scummvm-rg350-58648b08948129aafa9c678a18834052254f5b11.zip |
FULLPIPE: Implement StaticANIObject::changeStatics1()
-rw-r--r-- | engines/fullpipe/motion.cpp | 6 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 30 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 2 |
4 files changed, 34 insertions, 5 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index ca20e1f4be..9ae8acda84 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1824,6 +1824,12 @@ void MGM::clear() { _items.clear(); } +MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr) { + warning("STUB: MGM::genMQ()"); + + return 0; +} + MGMItem::MGMItem() { objId = 0; } diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index a5c93cecfc..8bcbf4deac 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -178,6 +178,7 @@ public: int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop); Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *mult, int *len, int flag); ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len); + MessageQueue *genMQ(StaticANIObject *ani, int staticsIndex, int staticsId, int *resStatId, Common::Point **pointArr); }; struct MctlLadderMovementVars { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index a3a160b5b2..4d813d3b0b 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -277,8 +277,11 @@ void StaticANIObject::deleteFromGlobalMessageQueue() { } } -void StaticANIObject::queueMessageQueue(MessageQueue *mq) { - if (isIdle() && !(_flags & 0x80)) { +bool StaticANIObject::queueMessageQueue(MessageQueue *mq) { + if (_flags & 0x80) + return false; + + if (isIdle()) { deleteFromGlobalMessageQueue(); _messageQueueId = 0; _messageNum = 0; @@ -296,6 +299,8 @@ void StaticANIObject::queueMessageQueue(MessageQueue *mq) { _messageQueueId = 0; } } + + return true; } void StaticANIObject::restartMessageQueue(MessageQueue *mq) { @@ -1019,9 +1024,26 @@ void StaticANIObject::adjustSomeXY() { } MessageQueue *StaticANIObject::changeStatics1(int msgNum) { - warning("STUB: StaticANIObject::changeStatics1(%d)", msgNum); + g_fp->_mgm->addItem(_id); - return 0; + MessageQueue *mq = g_fp->_mgm->genMQ(this, msgNum, 0, 0, 0); + + if (!mq) + return 0; + + if (mq->getCount() <= 0) { + g_fp->_globalMessageQueueList->addMessageQueue(mq); + + if (_flags & 1) + _messageQueueId = mq->_id; + } else { + if (!queueMessageQueue(mq)) + return 0; + + g_fp->_globalMessageQueueList->addMessageQueue(mq); + } + + return mq; } void StaticANIObject::changeStatics2(int objId) { diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 89703965cd..d5e7d533a7 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -217,7 +217,7 @@ public: void setAlpha(int alpha); void deleteFromGlobalMessageQueue(); - void queueMessageQueue(MessageQueue *msg); + bool queueMessageQueue(MessageQueue *msg); void restartMessageQueue(MessageQueue *msg); MessageQueue *getMessageQueue(); bool trySetMessageQueue(int msgNum, int qId); |