aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/messages.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-09-08 23:53:02 +0300
committerEugene Sandulenko2013-09-08 23:56:04 +0300
commit747e70a38ebd08450714fdb01dd45139ac9504a1 (patch)
tree61513c7f6b7272ba837f55194adf059bc114d735 /engines/fullpipe/messages.cpp
parent940c686858d9a0bf92c1473b9a81653a9937b88a (diff)
downloadscummvm-rg350-747e70a38ebd08450714fdb01dd45139ac9504a1.tar.gz
scummvm-rg350-747e70a38ebd08450714fdb01dd45139ac9504a1.tar.bz2
scummvm-rg350-747e70a38ebd08450714fdb01dd45139ac9504a1.zip
FULLPIPE: Implement CInteractionController::handleInteraction()
Diffstat (limited to 'engines/fullpipe/messages.cpp')
-rw-r--r--engines/fullpipe/messages.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index e4dfcf558f..acf44f5729 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -445,6 +445,38 @@ void MessageQueue::replaceKeyCode(int key1, int key2) {
}
}
+int MessageQueue::calcDuration(StaticANIObject *obj) {
+ int res;
+ ExCommand *ex;
+ Movement *mov;
+
+ for (uint i = 0; (ex = getExCommandByIndex(i)); i++)
+ if (ex->_parentId == obj->_id) {
+ if (ex->_messageKind == 1 || ex->_messageKind == 20) {
+ if ((mov = obj->getMovementById(ex->_messageNum)) != 0) {
+ if (ex->_field_14 >= 1)
+ res += ex->_field_14;
+ else
+ res += mov->calcDuration();
+ }
+ }
+ }
+
+ return res;
+}
+
+void MessageQueue::changeParam28ForObjectId(int objId, int oldParam28, int newParam28) {
+ for (uint i = 0; i < _exCommands.size(); i++) {
+ ExCommand *ex = getExCommandByIndex(i);
+ int k = ex->_messageKind;
+
+ if ((k == 1 || k == 20 || k == 5 || k == 6 || k == 2 || k == 18 || k == 19 || k == 22 || k == 55)
+ && ex->_keyCode == oldParam28
+ && ex->_parentId == objId)
+ ex->_keyCode = newParam28;
+ }
+}
+
MessageQueue *GlobalMessageQueueList::getMessageQueueById(int id) {
for (Common::Array<MessageQueue *>::iterator s = begin(); s != end(); ++s) {
if ((*s)->_id == id)