diff options
Diffstat (limited to 'engines/fullpipe/interaction.cpp')
-rw-r--r-- | engines/fullpipe/interaction.cpp | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index 4aac3485f4..8f6ec5dd72 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -62,7 +62,7 @@ InteractionController::~InteractionController() { } bool InteractionController::load(MfcArchive &file) { - debug(5, "InteractionController::load()"); + debugC(5, kDebugLoading, "InteractionController::load()"); return _interactions.load(file); } @@ -128,6 +128,8 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject if (cinter->_messageQueue) cinter->_messageQueue->calcDuration(subj); + debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic((byte *)cinter->_actionName)); + PicAniInfo aniInfo; obj->getPicAniInfo(&aniInfo); @@ -143,7 +145,8 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject obj->setPicAniInfo(&aniInfo); if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1) { - mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->doWalkTo(subj, xpos, ypos, 1, cinter->_staticsId2); + debugC(0, kDebugPathfinding, "Calling makeQueue() at [%d, %d]", xpos, ypos); + mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->makeQueue(subj, xpos, ypos, 1, cinter->_staticsId2); if (mq) { dur = mq->calcDuration(subj); delete mq; @@ -187,8 +190,8 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0); ex->_x = obj->_id; - ex->_y = obj->_okeyCode; - ex->_keyCode = subj ? subj->_okeyCode : 0; + ex->_y = obj->_odelay; + ex->_param = subj ? subj->_odelay : 0; ex->_excFlags = 3; ex->_field_14 = (obj->_objtype != kObjTypePictureObject); ex->_field_20 = invId; @@ -204,7 +207,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject LABEL_38: if (inter->_messageQueue) { mq = new MessageQueue(inter->_messageQueue, 0, 1); - mq->changeParam28ForObjectId(ani->_id, -1, ani->_okeyCode); + mq->changeParam28ForObjectId(ani->_id, -1, ani->_odelay); if (!mq->chain(0)) return false; @@ -252,27 +255,27 @@ LABEL_38: subj->setOXY(inter->_xOffs + obj->_ox, inter->_yOffs + obj->_oy); mq = new MessageQueue(inter->_messageQueue, 0, 1); - mq->changeParam28ForObjectId(obj->_id, -1, obj->_okeyCode); + mq->changeParam28ForObjectId(obj->_id, -1, obj->_odelay); mq->_flags |= 1; if (!(inter->_flags & 0x10000)) { ex = new ExCommand(obj->_id, 34, 0x80, 0, 0, 0, 1, 0, 0, 0); - ex->_keyCode = obj->_okeyCode; - ex->_field_14 = 0x100; + ex->_param = obj->_odelay; + ex->_field_14 = 0x80; ex->_messageNum = 0; ex->_excFlags = 3; mq->addExCommandToEnd(ex); } ex = new ExCommand(obj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0); - ex->_keyCode = obj->_okeyCode; + ex->_param = obj->_odelay; ex->_field_14 = 0x100; ex->_messageNum = 0; ex->_excFlags = 3; mq->addExCommandToEnd(ex); ex = new ExCommand(subj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0); - ex->_keyCode = subj->_okeyCode; + ex->_param = subj->_odelay; ex->_field_14 = 0x100; ex->_messageNum = 0; ex->_excFlags = 3; @@ -280,7 +283,7 @@ LABEL_38: ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags |= 3; - ex->_keyCode = 0; + ex->_param = 0; mq->addExCommandToEnd(ex); if (!mq->chain(subj)) { @@ -289,8 +292,8 @@ LABEL_38: return false; } - subj->_flags |= 1; - obj->_flags |= 1; + subj->_flags |= 0x100; + obj->_flags |= 0x100; } else { bool someFlag = false; PicAniInfo aniInfo; @@ -304,7 +307,7 @@ LABEL_38: ani->changeStatics2(inter->_staticsId1); } - int xpos = inter->_yOffs + obj->_ox; + int xpos = inter->_xOffs + obj->_ox; int ypos = inter->_yOffs + obj->_oy; obj->setPicAniInfo(&aniInfo); @@ -318,8 +321,8 @@ LABEL_38: ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0); ex->_x = obj->_id; - ex->_y = obj->_okeyCode; - ex->_keyCode = subj->_okeyCode; + ex->_y = obj->_odelay; + ex->_param = subj->_odelay; ex->_excFlags = 3; ex->_field_20 = invId; ex->_field_14 = (obj->_objtype != kObjTypePictureObject); @@ -331,9 +334,9 @@ LABEL_38: ex->_x = xpos; ex->_y = ypos; ex->_excFlags |= 3; - ex->_keyCode = 6; + ex->_param = 6; ex->_field_14 = obj->_id; - ex->_field_20 = obj->_okeyCode; + ex->_field_20 = obj->_odelay; ex->postMessage(); } @@ -361,21 +364,21 @@ LABEL_38: } else { ex = new ExCommand(ani->_id, 34, 0x80, 0, 0, 0, 1, 0, 0, 0); ex->_field_14 = 0x80; - ex->_keyCode = ani->_okeyCode; + ex->_param = ani->_odelay; ex->_excFlags = 3; mq->addExCommandToEnd(ex); } } ex = new ExCommand(ani->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0); - ex->_keyCode = ani->_okeyCode; + ex->_param = ani->_odelay; ex->_field_14 = 0x100; ex->_excFlags = 3; mq->addExCommandToEnd(ex); } else { ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0); ex->_x = ani->_id; - ex->_y = ani->_okeyCode; - ex->_keyCode = subj->_okeyCode; + ex->_y = ani->_odelay; + ex->_param = subj->_odelay; ex->_excFlags = 2; ex->_field_14 = (obj->_objtype != kObjTypePictureObject); ex->_field_20 = invId; @@ -388,7 +391,7 @@ LABEL_38: ani->queueMessageQueue(mq); } } else { - obj->_flags |= 1; + obj->_flags |= 0x100; if (inter->_flags & 0x10000) return true; @@ -432,7 +435,7 @@ Interaction::~Interaction() { if (_messageQueue) { while (_messageQueue->getExCommandByIndex(0)) _messageQueue->deleteExCommandByIndex(0, 1); - } + } delete _messageQueue; @@ -440,7 +443,7 @@ Interaction::~Interaction() { } bool Interaction::load(MfcArchive &file) { - debug(5, "Interaction::load()"); + debugC(5, kDebugLoading, "Interaction::load()"); _objectId1 = file.readUint16LE(); _objectId2 = file.readUint16LE(); @@ -449,8 +452,8 @@ bool Interaction::load(MfcArchive &file) { _objectId3 = file.readUint16LE(); _objectState2 = file.readUint32LE(); _objectState1 = file.readUint32LE(); - _xOffs = file.readUint32LE(); - _yOffs = file.readUint32LE(); + _xOffs = file.readSint32LE(); + _yOffs = file.readSint32LE(); _sceneId = file.readUint32LE(); _flags = file.readUint32LE(); _actionName = file.readPascalString(); @@ -531,7 +534,7 @@ bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) { } bool EntranceInfo::load(MfcArchive &file) { - debug(5, "EntranceInfo::load()"); + debugC(5, kDebugLoading, "EntranceInfo::load()"); _sceneId = file.readUint32LE(); _field_4 = file.readUint32LE(); |