[Scummvm-cvs-logs] scummvm master -> 8bdf4e38bee0e460703bddf9d45615b3ff628e33

sev- sev at scummvm.org
Mon Jun 2 09:38:09 CEST 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8979b79ecd FULLPIPE: More work on MctlLadder::doWalkTo()
8bdf4e38be FULLPIPE: Add missing parameter to Movement::calcSomeXY()


Commit: 8979b79ecd5de771c7c6405a0c54cc149f59051a
    https://github.com/scummvm/scummvm/commit/8979b79ecd5de771c7c6405a0c54cc149f59051a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-02T10:36:20+03:00

Commit Message:
FULLPIPE: More work on MctlLadder::doWalkTo()

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index a427ec7..ea7e09e 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -429,43 +429,44 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 
 	double dh = _height;
 	double corr = (double)(ani->_oy - _ladderY) / dh;
-	int dl = (int)(corr + (corr < 0.0 ? -0.5 : 0.5);
+	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;
+	corr = (double)(ypos - _ladderY) / dh;
+	int dl2 = (int)(corr + (corr < 0.0 ? -0.5 : 0.5));
 
-	if (dl == (_DWORD)v14 || (signed int)v14 < 0)
+	int normx = _ladderX + dl2 * _width;
+	int normy = _ladderY + dl2 * _height;
+
+	if (dl == dl2 || dl2 < 0)
 		return 0;
 
-	v17 = v16 - ani->go._oy;
-	v18 = ani->_movement;
-	v19 = v17 < 0;
-	point1.x = v17 < 0;
+	int direction = (normy - ani->_oy) < 0 ? 0 : 1;
 
 	MGMInfo mgminfo;
-	PicAniInfo picAniInfo;
+	PicAniInfo picinfo;
+	MessageQueue *mq;
+	Common::Point point;
+
+	if (ani->_movement) {
+		ani->getPicAniInfo(&picinfo);
 
-	if (v18) {
-		GameObject_getPicAniInfo(ani, (PicAniInfo *)&mgminfo);
-		v20 = ani->go._ox;
-		v73 = ani->go._oy;
+		v20 = ani->_ox;
+		v73 = ani->_oy;
 		StaticANIObject_getSomeDynamicPhaseIndex(ani);
-		v21 = Movement_calcSomeXY(ani->_movement, &point, 1);
-		v22 = v21->x + v20;
-		v23 = v21->y + v73;
+		v21 = ani->_movement->calcSomeXY(&point, 1);
+		v22 = point.x + v20;
+		v23 = point.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;
+		mq = doWalkTo(ani, normx, normy, fuzzyMatch, staticsId);
+
+		ani->setPicAniInfo(&picinfo);
+
+		return mq;
 	}
+
 	v27 = _ladmovements.m_pData;
 	LOWORD(v19) = ani->_statics->_staticsId;
 	movidx = pos;
@@ -478,33 +479,33 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		if ((_WORD)staticsId)
 			mgminfo.staticsId2 = (unsigned __int16)staticsId;
 		else
-			mgminfo.staticsId2 = v29->staticIds[point1.x == 0];
-		mgminfo.x1 = xposa;
+			mgminfo.staticsId2 = v29->staticIds[direction];
+		mgminfo.x1 = normx;
 		v31 = _ladder_field_14;
-		mgminfo.y1 = yposa;
+		mgminfo.y1 = normy;
 		mgminfo.field_1C = v31;
 		mgminfo.flags = 14;
-		mgminfo.movementId = *(&v29->movVars->varUpGo + (point1.x == 0));
+		mgminfo.movementId = *(&v29->movVars->varUpGo + direction);
 		return MGM_genMovement(&_mgm, &mgminfo);
 	}
 	if ((unsigned __int16)point.x == stids[2]) {
-		if (point1.x) {
+		if (!direction) {
 			memset(&mgminfo, 0, sizeof(mgminfo));
 			mgminfo.ani = ani;
 			if ( (_WORD)staticsId )
 				mgminfo.staticsId2 = (unsigned __int16)staticsId;
 			else
 				mgminfo.staticsId2 = *v29->staticIds;
-			mgminfo.x1 = xposa;
+			mgminfo.x1 = normx;
 			v32 = _ladder_field_14;
-			mgminfo.y1 = yposa;
+			mgminfo.y1 = normy;
 			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;
+		v33 = ani->_ox;
+		v73 = ani->_oy;
 		v34 = StaticANIObject_getMovementById(ani, LOWORD(v29->movVars->varUpStop));
 		v35 = Movement_calcSomeXY(v34, &point, 0);
 		v36 = v35->y;
@@ -517,10 +518,10 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		else
 			mgminfo.staticsId2 = _ladmovements.m_pData[movidx].staticIds[1];
 		v37 = _ladder_field_14;
-		mgminfo.y1 = yposa;
+		mgminfo.y1 = normy;
 		mgminfo.field_1C = v37;
 		v38 = _ladmovements.m_pData;
-		mgminfo.x1 = xposa;
+		mgminfo.x1 = normx;
 		mgminfo.y2 = v73;
 		v39 = &v38[movidx];
 		mgminfo.x2 = v72;
@@ -528,18 +529,18 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		mgminfo.flags = 63;
 		mgminfo.staticsId1 = v40;
 		mgminfo.movementId = v39->movVars->varDownGo;
-		v41 = (int)MGM_genMovement(&_mgm, &mgminfo);
+		v41 = _mgm->genMovement(&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);
+			v44 = ExCommand_ctor(v43, ani->_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;
+			v44->msg._keyCode = ani->_okeyCode;
 			v76 = -1;
 			v44->_excFlags = v45;
 			MessageQueue_insertExCommandAt(v42, 0, v44);
@@ -554,16 +555,16 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		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;
+			v59 = ani->_ox;
+			point.y = ani->_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);
+			v61 = MGM_getPoint(&_mgm, &point1, ani->_id, (__int16)v58, *(_WORD *)v60[movidx].staticIds);
 			v62 = v61->y;
 			point.x += v61->x;
 			point.y += v62;
-			GameObject_getPicAniInfo(ani, &picAniInfo);
+			GameObject_getPicAniInfo(ani, &picinfo);
 			v63 = StaticANIObject_getStaticsById(ani, (Objects)*(_WORD *)_ladmovements.m_pData[movidx].staticIds);
 			v64 = point.x;
 			v65 = ani->go.CObject.vmt;
@@ -571,22 +572,22 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 			v66 = point.y;
 			ani->_movement = 0;
 			ani->sotOXY(v64, v66);
-			v67 = doWalkTo(ani, v15, yposa, fuzzyMatch, staticsId);
+			v67 = doWalkTo(ani, normx, normy, 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);
+			GameObject_setPicAniInfo(ani, &picinfo);
 			return (MessageQueue *)v68;
 		}
 		return 0;
 	}
 
-	if (point1.x) {
+	if (!direction) {
 		v46 = v29->movVars;
-		v47 = ani->go._ox;
-		v73 = ani->go._oy;
+		v47 = ani->_ox;
+		v73 = ani->_oy;
 		v48 = StaticANIObject_getMovementById(ani, LOWORD(v46->varDownStop));
 		v49 = Movement_calcSomeXY(v48, &point, 0);
 		v50 = v49->y;
@@ -599,10 +600,10 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		else
 			mgminfo.staticsId2 = *_ladmovements.m_pData[movidx].staticIds;
 		v51 = _ladder_field_14;
-		mgminfo.y1 = yposa;
+		mgminfo.y1 = normy;
 		mgminfo.field_1C = v51;
 		v52 = _ladmovements.m_pData;
-		mgminfo.x1 = xposa;
+		mgminfo.x1 = normx;
 		mgminfo.y2 = v73;
 		v53 = &v52[movidx];
 		mgminfo.x2 = v72;
@@ -617,7 +618,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		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);
+			v44 = ExCommand_ctor(v56, ani->_id, 1, _ladmovements.m_pData[movidx].movVars->varDownStop, 0, 0, 0, 1, 0, 0, 0);
 			v42 = (MessageQueue *)v72;
 			goto LABEL_29;
 		}
@@ -629,9 +630,9 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		mgminfo.staticsId2 = (unsigned __int16)staticsId;
 	else
 		mgminfo.staticsId2 = v29->staticIds[1];
-	mgminfo.x1 = xposa;
+	mgminfo.x1 = normx;
 	v57 = _ladder_field_14;
-	mgminfo.y1 = yposa;
+	mgminfo.y1 = normy;
 	mgminfo.field_1C = v57;
 	mgminfo.flags = 14;
 	mgminfo.movementId = v29->movVars->varDownGo;


Commit: 8bdf4e38bee0e460703bddf9d45615b3ff628e33
    https://github.com/scummvm/scummvm/commit/8bdf4e38bee0e460703bddf9d45615b3ff628e33
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-02T10:36:20+03:00

Commit Message:
FULLPIPE: Add missing parameter to Movement::calcSomeXY()

Changed paths:
    engines/fullpipe/motion.cpp
    engines/fullpipe/scenes/scene06.cpp
    engines/fullpipe/scenes/scene25.cpp
    engines/fullpipe/statics.cpp
    engines/fullpipe/statics.h



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index ea7e09e..4492168 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -453,7 +453,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		v20 = ani->_ox;
 		v73 = ani->_oy;
 		StaticANIObject_getSomeDynamicPhaseIndex(ani);
-		v21 = ani->_movement->calcSomeXY(&point, 1);
+		v21 = ani->_movement->calcSomeXY(&point, 1, _someDynamicPhaseIndex);
 		v22 = point.x + v20;
 		v23 = point.y + v73;
 		v24 = ani->go.CObject.vmt;
@@ -507,7 +507,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		v33 = ani->_ox;
 		v73 = ani->_oy;
 		v34 = StaticANIObject_getMovementById(ani, LOWORD(v29->movVars->varUpStop));
-		v35 = Movement_calcSomeXY(v34, &point, 0);
+		v35 = Movement_calcSomeXY(v34, &point, 0, -1);
 		v36 = v35->y;
 		v72 = v35->x + v33;
 		v73 += v36;
@@ -589,7 +589,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int
 		v47 = ani->_ox;
 		v73 = ani->_oy;
 		v48 = StaticANIObject_getMovementById(ani, LOWORD(v46->varDownStop));
-		v49 = Movement_calcSomeXY(v48, &point, 0);
+		v49 = Movement_calcSomeXY(v48, &point, 0, -1);
 		v50 = v49->y;
 		v72 = v49->x + v47;
 		v73 += v50;
@@ -1718,7 +1718,7 @@ bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) {
 
 			item->_subItems[dir]._walk[act]._mov = mov;
 			if (mov) {
-				mov->calcSomeXY(point, 0);
+				mov->calcSomeXY(point, 0, -1);
 				item->_subItems[dir]._walk[act]._mx = point.x;
 				item->_subItems[dir]._walk[act]._my = point.y;
 			}
@@ -1748,7 +1748,7 @@ bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) {
 
 			item->_subItems[dir]._turn[act]._mov = mov;
 			if (mov) {
-				mov->calcSomeXY(point, 0);
+				mov->calcSomeXY(point, 0, -1);
 				item->_subItems[dir]._turn[act]._mx = point.x;
 				item->_subItems[dir]._turn[act]._my = point.y;
 			}
@@ -1778,7 +1778,7 @@ bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) {
 
 			item->_subItems[dir]._turnS[act]._mov = mov;
 			if (mov) {
-				mov->calcSomeXY(point, 0);
+				mov->calcSomeXY(point, 0, -1);
 				item->_subItems[dir]._turnS[act]._mx = point.x;
 				item->_subItems[dir]._turnS[act]._my = point.y;
 			}
@@ -2149,7 +2149,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
 			newx = obj->_ox;
 			newy = obj->_oy;
 		} else {
-			obj->_movement->calcSomeXY(point, 0);
+			obj->_movement->calcSomeXY(point, 0, picAniInfo.dynamicPhaseIndex);
 			newx = obj->_movement->_ox - point.x;
 			newy = obj->_movement->_oy - point.y;
 			if (idxsub != 1 && idxsub) {
@@ -2834,7 +2834,7 @@ MessageQueue *MGM::genMQ(StaticANIObject *ani, int staticsIndex, int staticsId,
 	do {
 		subidx = startidx + endidx * _items[idx]->statics.size();
 
-		_items[idx]->subItems[subidx]->movement->calcSomeXY(point, 0);
+		_items[idx]->subItems[subidx]->movement->calcSomeXY(point, 0, -1);
 
 		if (pointArr) {
 			int sz;
@@ -2997,7 +2997,7 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
 
 	Common::Point point1;
 
-	mov->calcSomeXY(point1, 0);
+	mov->calcSomeXY(point1, 0, -1);
 
 	int n2x = point1.x;
 	int n2y = point1.y;
@@ -3285,7 +3285,7 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
 						item->subItems[subIdx]->field_8 = recalc + 1;
 						item->subItems[subIdx]->field_C = newsz;
 
-						mov->calcSomeXY(point, 0);
+						mov->calcSomeXY(point, 0, -1);
 
 						item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x + point.x;
 						item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y + point.y;
@@ -3310,7 +3310,7 @@ int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
 
 							item->subItems[subIdx]->field_C = sz + item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->field_C;
 
-							mov->calcSomeXY(point, 0);
+							mov->calcSomeXY(point, 0, -1);
 
 							item->subItems[subIdx]->x = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->x - point.x;
 							item->subItems[subIdx]->y = item->subItems[stidx + 6 * st2idx * _items[idx]->statics.size()]->y - point.y;
@@ -3350,7 +3350,7 @@ int MGM::refreshOffsets(int objectId, int idx1, int idx2) {
 Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *mult, int *len, int flag) {
 	Common::Point point;
 
-	mov->calcSomeXY(point, 0);
+	mov->calcSomeXY(point, 0, -1);
 	int p1x = point.x;
 	int p1y = point.y;
 
@@ -3358,10 +3358,10 @@ Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y,
 	int oldlen = *len;
 
 	if (abs(p1y) > abs(p1x)) {
-		if (mov->calcSomeXY(point, 0)->y)
-			newmult = (int)((double)y / point.y);
-	} else if (mov->calcSomeXY(point, 0)->x) {
-		newmult = (int)((double)x / point.y);
+		if (mov->calcSomeXY(point, 0, -1)->y)
+			newmult = (int)((double)y / mov->calcSomeXY(point, 0, -1)->y);
+	} else if (mov->calcSomeXY(point, 0, -1)->x) {
+		newmult = (int)((double)x / mov->calcSomeXY(point, 0, -1)->x);
 	}
 
 	if (newmult < 0)
@@ -3374,26 +3374,20 @@ Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y,
 
 	if (flag) {
 		if (abs(p1y) > abs(p1x)) {
-			while (abs(p1y * newmult + mov->calcSomeXY(point, 0)->y) < abs(y)) {
+			while (abs(p1y * newmult + mov->calcSomeXY(point, 0, phase)->y) < abs(y)) {
 				sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
 
-				if (phase >= sz) {
-					phase--;
-
+				if (phase > sz)
 					break;
-				}
 
 				phase++;
 			}
 		} else {
-			while (abs(p1x * newmult + mov->calcSomeXY(point, 0)->x) < abs(x)) {
+			while (abs(p1x * newmult + mov->calcSomeXY(point, 0, phase)->x) < abs(x)) {
 				sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
 
-				if (phase >= sz) {
-					phase--;
-
+				if (phase >= sz)
 					break;
-				}
 
 				phase++;
 			}
@@ -3413,7 +3407,7 @@ Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y,
 	if (oldlen > 0) {
 		++*mult;
 
-		mov->calcSomeXY(point, 0);
+		mov->calcSomeXY(point, 0, oldlen);
 		p2x = point.x;
 		p2y = point.y;
 
diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp
index d54ebf4..06ec20d 100644
--- a/engines/fullpipe/scenes/scene06.cpp
+++ b/engines/fullpipe/scenes/scene06.cpp
@@ -438,23 +438,23 @@ void sceneHandler06_catchBall() {
 
 			if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPFW) {
 				if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 5) {
-					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0);
+					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex);
 
 					point.x = -point.x;
 					point.y = -point.y;
 				} else {
-					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1);
+					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1, -1);
 
 					g_vars->scene06_mumsyPos++;
 				}
 			} else if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPBK) {
 				if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 4) {
-					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0);
+					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex);
 
 					point.x = -point.x;
 					point.y = -point.y;
 				} else {
-					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1);
+					g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1, -1);
 
 					g_vars->scene06_mumsyPos--;
 				}
diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp
index fae311e..a07330f 100644
--- a/engines/fullpipe/scenes/scene25.cpp
+++ b/engines/fullpipe/scenes/scene25.cpp
@@ -442,7 +442,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa
 
 	if (flag) {
 		if (ani->_movement) {
-			ani->_movement->calcSomeXY(point, 0);
+			ani->_movement->calcSomeXY(point, 0, ani->_movement->_currDynamicPhaseIndex);
 			newx = point.x;
 			aniY = ani->_oy - point.y;
 		}
@@ -479,7 +479,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa
 				newy = pnty;
 			}
 
-			ani->getMovementById(ex->_messageNum)->calcSomeXY(point, 0);
+			ani->getMovementById(ex->_messageNum)->calcSomeXY(point, 0, -1);
 			pntx += point.x;
 			pnty += point.y;
 		}
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index b6b312a..5d7de05 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -893,7 +893,7 @@ void StaticANIObject::updateStepPos() {
 	int ox = _movement->_ox;
 	int oy = _movement->_oy;
 
-	_movement->calcSomeXY(point, 1);
+	_movement->calcSomeXY(point, 1, _someDynamicPhaseIndex);
 	int x = point.x;
 	int y = point.y;
 
@@ -917,7 +917,7 @@ Common::Point *StaticANIObject::calcNextStep(Common::Point *pRes) {
 
 	Common::Point point;
 
-	_movement->calcSomeXY(point, 1);
+	_movement->calcSomeXY(point, 1, _someDynamicPhaseIndex);
 
 	int resX = point.x;
 	int resY = point.y;
@@ -1016,11 +1016,11 @@ void StaticANIObject::adjustSomeXY() {
 	if (_movement) {
 		Common::Point point;
 
-		_movement->calcSomeXY(point, 0);
+		_movement->calcSomeXY(point, 0, -1);
 
 		int diff = abs(point.y) - abs(point.x);
 
-		_movement->calcSomeXY(point, 1);
+		_movement->calcSomeXY(point, 1, -1);
 
 		if (diff > 0)
 			_ox += point.x;
@@ -1382,7 +1382,7 @@ Common::Point *StaticANIObject::calcStepLen(Common::Point *p) {
 	if (_movement) {
 		Common::Point point;
 
-		_movement->calcSomeXY(point, 0);
+		_movement->calcSomeXY(point, 0, _movement->_currDynamicPhaseIndex);
 
 		p->x = point.x;
 		p->y = point.y;
@@ -1742,7 +1742,7 @@ Common::Point *Movement::getCurrDynamicPhaseXY(Common::Point &p) {
 	return &p;
 }
 
-Common::Point *Movement::calcSomeXY(Common::Point &p, int idx) {
+Common::Point *Movement::calcSomeXY(Common::Point &p, int idx, int dynidx) {
 	int oldox = _ox;
 	int oldoy = _oy;
 	int oldidx = _currDynamicPhaseIndex;
@@ -1765,7 +1765,7 @@ Common::Point *Movement::calcSomeXY(Common::Point &p, int idx) {
 
 	setOXY(x, y);
 
-	while (_currDynamicPhaseIndex != idx)
+	while (_currDynamicPhaseIndex != dynidx)
 		gotoNextFrame(0, 0);
 
 	p.x = _ox;
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 6366115..c7baac7 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -146,7 +146,7 @@ class Movement : public GameObject {
 	Common::Point *getCenter(Common::Point *p);
 	Common::Point *getDimensionsOfPhase(Common::Point *p, int phaseIndex);
 
-	Common::Point *calcSomeXY(Common::Point &p, int idx);
+	Common::Point *calcSomeXY(Common::Point &p, int idx, int dynidx);
 
 	void initStatics(StaticANIObject *ani);
 	void updateCurrDynamicPhase();






More information about the Scummvm-git-logs mailing list