diff options
author | Eugene Sandulenko | 2013-12-14 14:49:59 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-12-14 15:15:10 +0200 |
commit | 2c5b5cbb92455bb37d3061facf5178531c7b9142 (patch) | |
tree | 94015a93ad4ff936d0d5ef8c8780c657d3f32788 /engines | |
parent | 87f69f078e483958e8263352ad2d8c5478fb3042 (diff) | |
download | scummvm-rg350-2c5b5cbb92455bb37d3061facf5178531c7b9142.tar.gz scummvm-rg350-2c5b5cbb92455bb37d3061facf5178531c7b9142.tar.bz2 scummvm-rg350-2c5b5cbb92455bb37d3061facf5178531c7b9142.zip |
FULLPIPE: Implement sceneHandler04_sub8()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/constants.h | 3 | ||||
-rw-r--r-- | engines/fullpipe/motion.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 8 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene04.cpp | 80 |
4 files changed, 87 insertions, 8 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index ee89d4eec8..b2ebea6701 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -121,16 +121,19 @@ namespace Fullpipe { #define MV_KZW_RAISEHEAD 577 #define MV_KZW_STANDUP 563 #define MV_KZW_TURN 562 +#define MV_MAN_FROMLADDER 493 #define MV_MAN_GOD 481 #define MV_MAN_GOLADDER 451 #define MV_MAN_GOLADDER2 2844 #define MV_MAN_GOU 460 #define MV_MAN_JUMPONPLANK 551 #define MV_MAN_LOOKLADDER 520 +#define MV_MAN_LOOKLADDERRV 556 #define MV_MAN_LOOKUP 4773 #define MV_MAN_PLANKTOLADDER 553 #define MV_MAN_STARTLADDER 452 #define MV_MAN_STARTLADDER2 2842 +#define MV_MAN_STARTLADDERD 457 #define MV_MAN_STOPLADDER 454 #define MV_MAN_STOPLADDER2 2845 #define MV_MAN_TOLADDER 448 diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index fbe2768486..3451259893 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -309,6 +309,10 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *subj, int xpos, int ypos, in return 0; } +MessageQueue *MctlLadder::controllerWalkTo(StaticANIObject *ani, int off) { + return doWalkTo(ani, _objId + off * _ladder_field_18, _ladderY + off * _height, 1, 0); +} + MctlConnectionPoint *MctlCompound::findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr) { warning("STUB: MctlCompound::findClosestConnectionPoint()"); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 21841af134..b1e4b69676 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -76,9 +76,7 @@ public: }; class MctlCompoundArrayItem : public CObject { - friend class MctlCompound; - -protected: +public: MotionController *_motionControllerObj; MovGraphReact *_movGraphReactObj; Common::Array<MctlConnectionPoint *> _connectionPoints; @@ -96,9 +94,9 @@ class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public }; class MctlCompound : public MotionController { +public: MctlCompoundArray _motionControllers; - public: MctlCompound() { _objtype = kObjTypeMctlCompound; } virtual bool load(MfcArchive &file); @@ -204,6 +202,8 @@ public: virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId); + MessageQueue *controllerWalkTo(StaticANIObject *ani, int off); + private: int findObjectPos(StaticANIObject *obj); bool initMovement(StaticANIObject *ani, MctlLadderMovement *movement); diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 78695cc33a..8c4dba0d09 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -1033,10 +1033,6 @@ void sceneHandler04_goClock() { g_vars->scene04_var14 = 0; } -void sceneHandler04_sub8(ExCommand *ex) { - warning("STUB: sceneHandler04_sub8()"); -} - void sceneHandler04_sub12() { StaticANIObject *ball = g_fullpipe->_currentScene->getStaticANIObject1ById(ANI_BIGBALL, -1); @@ -1047,6 +1043,82 @@ void sceneHandler04_sub12() { g_vars->scene04_var13 = 0; } +void sceneHandler04_sub8(ExCommand *ex) { + if (!g_fullpipe->_aniMan->isIdle()) + return; + + if (!(g_fullpipe->_aniMan->_flags & 0x100)) { + if (getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->_objtype == kObjTypeMctlCompound) { + MctlCompound *mc = (MctlCompound *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId); + + if (mc->_motionControllers[0]->_movGraphReactObj->pointInRegion(g_fullpipe->_sceneRect.left + ex->_x, g_fullpipe->_sceneRect.top + ex->_y)) { + if (g_vars->scene04_ladder->collisionDetection(g_fullpipe->_aniMan)) { + MessageQueue *mq = g_vars->scene04_ladder->controllerWalkTo(g_fullpipe->_aniMan, 0); + + if (mq) { + mq->addExCommandToEnd(new ExCommand(ex)); + + if (mq->chain(g_fullpipe->_aniMan) ) + ex->_messageKind = 0; + else + delete mq; + + if (g_vars->scene04_var13) { + sceneHandler04_sub12(); + return; + } + } + } else { + MessageQueue *mq = new MessageQueue(g_fullpipe->_globalMessageQueueList->compact()); + ExCommand *ex1; + + if (g_fullpipe->_aniMan->_statics->_staticsId == ST_MAN_LADDERDOWN) { + ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_LOOKLADDERRV, 0, 0, 0, 1, 0, 0, 0); + ex1->_keyCode = g_fullpipe->_aniMan->_okeyCode; + ex1->_excFlags |= 2; + mq->addExCommandToEnd(ex1); + } + + ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_STARTLADDERD, 0, 0, 0, 1, 0, 0, 0); + ex1->_keyCode = g_fullpipe->_aniMan->_okeyCode; + ex1->_excFlags |= 2; + mq->addExCommandToEnd(ex1); + + ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_FROMLADDER, 0, 0, 0, 1, 0, 0, 0); + ex1->_keyCode = g_fullpipe->_aniMan->_okeyCode; + ex1->_excFlags |= 2; + mq->addExCommandToEnd(ex1); + + ex1 = new ExCommand(ex); + mq->addExCommandToEnd(ex1); + + mq->setFlags(mq->getFlags() | 1); + + if (mq->chain(g_fullpipe->_aniMan)) { + if (g_vars->scene04_ladder) + delete g_vars->scene04_ladder; + + g_vars->scene04_ladder = 0; + g_vars->scene04_dudeOnLadder = 0; + + ex->_messageKind = 0; + + mc->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + } else if (mq) { + delete mq; + } + + if (g_vars->scene04_var13) { + sceneHandler04_sub12(); + return; + } + } + } + } + } +} + void sceneHandler04_handTake() { g_vars->scene04_clock->changeStatics2(ST_CLK_CLOSED); |