aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorEugene Sandulenko2014-06-01 12:05:55 +0300
committerEugene Sandulenko2014-06-01 16:49:41 +0300
commit7227d723a40080c0d65ec0a5cd0f37b6f480ec37 (patch)
treec7edea767801257fec9ac580909a70f0a3bf3fe2 /engines/fullpipe
parent913947c2477264860339596128eae5b2a11c20e8 (diff)
downloadscummvm-rg350-7227d723a40080c0d65ec0a5cd0f37b6f480ec37.tar.gz
scummvm-rg350-7227d723a40080c0d65ec0a5cd0f37b6f480ec37.tar.bz2
scummvm-rg350-7227d723a40080c0d65ec0a5cd0f37b6f480ec37.zip
FULLPIPE: Started implmentation of MctlLadder::doWalkTo()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/motion.cpp219
1 files changed, 218 insertions, 1 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index b96d2d8bef..a427ec7880 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -420,7 +420,224 @@ MessageQueue *MctlLadder::method34(StaticANIObject *subj, int xpos, int ypos, in
return 0;
}
-MessageQueue *MctlLadder::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
+MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) {
+#if 0
+ int pos = findObjectPos(ani);
+
+ if (pos < 0)
+ return 0;
+
+ double dh = _height;
+ double corr = (double)(ani->_oy - _ladderY) / dh;
+ int dl = (int)(corr + (corr < 0.0 ? -0.5 : 0.5);
+
+ v12 = (double)(ypos - _ladderY) / dh;
+ v13 = v12 < 0.0 ? -0.5 : 0.5;
+ v14 = (signed __int64)(v12 + v13);
+ v15 = _ladderX + v14 * _width;
+ v16 = _ladderY + v14 * _height;
+ xposa = this->_ladderX + v14 * _width;
+ yposa = v16;
+
+ if (dl == (_DWORD)v14 || (signed int)v14 < 0)
+ return 0;
+
+ v17 = v16 - ani->go._oy;
+ v18 = ani->_movement;
+ v19 = v17 < 0;
+ point1.x = v17 < 0;
+
+ MGMInfo mgminfo;
+ PicAniInfo picAniInfo;
+
+ if (v18) {
+ GameObject_getPicAniInfo(ani, (PicAniInfo *)&mgminfo);
+ v20 = ani->go._ox;
+ v73 = ani->go._oy;
+ StaticANIObject_getSomeDynamicPhaseIndex(ani);
+ v21 = Movement_calcSomeXY(ani->_movement, &point, 1);
+ v22 = v21->x + v20;
+ v23 = v21->y + v73;
+ v24 = ani->go.CObject.vmt;
+ ani->_statics = ani->_movement->_staticsObj2;
+ ani->_movement = 0;
+ ani->setOXY(v22, v23);
+ v25 = doWalkTo(ani, v15, yposa, fuzzyMatch, staticsId);
+ GameObject_setPicAniInfo(ani, (PicAniInfo *)&mgminfo);
+ return (MessageQueue *)v25;
+ }
+ v27 = _ladmovements.m_pData;
+ LOWORD(v19) = ani->_statics->_staticsId;
+ movidx = pos;
+ point.x = v19;
+ v29 = &v27[pos];
+ stids = v27[pos].staticIds;
+ if ((unsigned __int16)v19 == *stids) {
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ if ((_WORD)staticsId)
+ mgminfo.staticsId2 = (unsigned __int16)staticsId;
+ else
+ mgminfo.staticsId2 = v29->staticIds[point1.x == 0];
+ mgminfo.x1 = xposa;
+ v31 = _ladder_field_14;
+ mgminfo.y1 = yposa;
+ mgminfo.field_1C = v31;
+ mgminfo.flags = 14;
+ mgminfo.movementId = *(&v29->movVars->varUpGo + (point1.x == 0));
+ return MGM_genMovement(&_mgm, &mgminfo);
+ }
+ if ((unsigned __int16)point.x == stids[2]) {
+ if (point1.x) {
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ if ( (_WORD)staticsId )
+ mgminfo.staticsId2 = (unsigned __int16)staticsId;
+ else
+ mgminfo.staticsId2 = *v29->staticIds;
+ mgminfo.x1 = xposa;
+ v32 = _ladder_field_14;
+ mgminfo.y1 = yposa;
+ mgminfo.field_1C = v32;
+ mgminfo.flags = 14;
+ mgminfo.movementId = v29->movVars->varUpGo;
+ return MGM_genMovement(&_mgm, &mgminfo);
+ }
+ v33 = ani->go._ox;
+ v73 = ani->go._oy;
+ v34 = StaticANIObject_getMovementById(ani, LOWORD(v29->movVars->varUpStop));
+ v35 = Movement_calcSomeXY(v34, &point, 0);
+ v36 = v35->y;
+ v72 = v35->x + v33;
+ v73 += v36;
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ if ( (_WORD)staticsId )
+ mgminfo.staticsId2 = (unsigned __int16)staticsId;
+ else
+ mgminfo.staticsId2 = _ladmovements.m_pData[movidx].staticIds[1];
+ v37 = _ladder_field_14;
+ mgminfo.y1 = yposa;
+ mgminfo.field_1C = v37;
+ v38 = _ladmovements.m_pData;
+ mgminfo.x1 = xposa;
+ mgminfo.y2 = v73;
+ v39 = &v38[movidx];
+ mgminfo.x2 = v72;
+ v40 = *v38[movidx].staticIds;
+ mgminfo.flags = 63;
+ mgminfo.staticsId1 = v40;
+ mgminfo.movementId = v39->movVars->varDownGo;
+ v41 = (int)MGM_genMovement(&_mgm, &mgminfo);
+ v42 = (MessageQueue *)v41;
+ v72 = v41;
+ v43 = (ExCommand *)operator new(0x48u);
+ point.x = (LONG)v43;
+ v76 = 0;
+ if (v43) {
+ v44 = ExCommand_ctor(v43, ani->go._id, 1, _ladmovements.m_pData[movidx].movVars->varUpStop, 0, 0, 0, 1, 0, 0, 0);
+ v42 = (MessageQueue *)v72;
+ LABEL_29:
+ v45 = v44->_excFlags | 2;
+ v44->msg._keyCode = ani->go._okeyCode;
+ v76 = -1;
+ v44->_excFlags = v45;
+ MessageQueue_insertExCommandAt(v42, 0, v44);
+ return v42;
+ }
+ LABEL_28:
+ v44 = 0;
+ goto LABEL_29;
+ }
+ if ((unsigned __int16)point.x != stids[3]) {
+ LOWORD(stids) = *(_WORD *)v29->staticIds;
+ v72 = (int)MGM_genMQ(&_mgm, ani, (int)stids, 0, 0, 0);
+ if (v72) {
+ v58 = ani->_statics;
+ v59 = ani->go._ox;
+ point.y = ani->go._oy;
+ v60 = _ladmovements.m_pData;
+ LOWORD(v58) = v58->_staticsId;
+ point.x = v59;
+ v61 = MGM_getPoint(&_mgm, &point1, ani->go._id, (__int16)v58, *(_WORD *)v60[movidx].staticIds);
+ v62 = v61->y;
+ point.x += v61->x;
+ point.y += v62;
+ GameObject_getPicAniInfo(ani, &picAniInfo);
+ v63 = StaticANIObject_getStaticsById(ani, (Objects)*(_WORD *)_ladmovements.m_pData[movidx].staticIds);
+ v64 = point.x;
+ v65 = ani->go.CObject.vmt;
+ ani->_statics = v63;
+ v66 = point.y;
+ ani->_movement = 0;
+ ani->sotOXY(v64, v66);
+ v67 = doWalkTo(ani, v15, yposa, fuzzyMatch, staticsId);
+ v68 = v72;
+ v69 = v67;
+ MessageQueue_transferExCommands((MessageQueue *)v72, v67);
+ if ( v69 )
+ (*(void (__thiscall **)(MessageQueue *, signed int))(v69->CObject.vmt + 4))(v69, 1);
+ GameObject_setPicAniInfo(ani, &picAniInfo);
+ return (MessageQueue *)v68;
+ }
+ return 0;
+ }
+
+ if (point1.x) {
+ v46 = v29->movVars;
+ v47 = ani->go._ox;
+ v73 = ani->go._oy;
+ v48 = StaticANIObject_getMovementById(ani, LOWORD(v46->varDownStop));
+ v49 = Movement_calcSomeXY(v48, &point, 0);
+ v50 = v49->y;
+ v72 = v49->x + v47;
+ v73 += v50;
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ if ((_WORD)staticsId)
+ mgminfo.staticsId2 = (unsigned __int16)staticsId;
+ else
+ mgminfo.staticsId2 = *_ladmovements.m_pData[movidx].staticIds;
+ v51 = _ladder_field_14;
+ mgminfo.y1 = yposa;
+ mgminfo.field_1C = v51;
+ v52 = _ladmovements.m_pData;
+ mgminfo.x1 = xposa;
+ mgminfo.y2 = v73;
+ v53 = &v52[movidx];
+ mgminfo.x2 = v72;
+ v54 = v52[movidx].staticIds[1];
+ mgminfo.flags = 63;
+ mgminfo.staticsId1 = v54;
+ mgminfo.movementId = v53->movVars->varUpGo;
+ v55 = MGM_genMovement(&_mgm, &mgminfo);
+ v42 = v55;
+ v72 = (int)v55;
+ v56 = (ExCommand *)operator new(0x48u);
+ point.x = (LONG)v56;
+ v76 = 1;
+ if (v56) {
+ v44 = ExCommand_ctor(v56, ani->go._id, 1, _ladmovements.m_pData[movidx].movVars->varDownStop, 0, 0, 0, 1, 0, 0, 0);
+ v42 = (MessageQueue *)v72;
+ goto LABEL_29;
+ }
+ goto LABEL_28;
+ }
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ if ((_WORD)staticsId)
+ mgminfo.staticsId2 = (unsigned __int16)staticsId;
+ else
+ mgminfo.staticsId2 = v29->staticIds[1];
+ mgminfo.x1 = xposa;
+ v57 = _ladder_field_14;
+ mgminfo.y1 = yposa;
+ mgminfo.field_1C = v57;
+ mgminfo.flags = 14;
+ mgminfo.movementId = v29->movVars->varDownGo;
+
+ return _mgm->genMovement(&mgminfo);
+#endif
warning("STUB: MctlLadder::doWalkTo()");
return 0;