[Scummvm-cvs-logs] scummvm master -> 7227d723a40080c0d65ec0a5cd0f37b6f480ec37

sev- sev at scummvm.org
Sun Jun 1 15:50:30 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:
913947c247 FULLPIPE: Rename class variable to avoid confusion
7227d723a4 FULLPIPE: Started implmentation of MctlLadder::doWalkTo()


Commit: 913947c2477264860339596128eae5b2a11c20e8
    https://github.com/scummvm/scummvm/commit/913947c2477264860339596128eae5b2a11c20e8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-01T16:49:41+03:00

Commit Message:
FULLPIPE: Rename class variable to avoid confusion

Changed paths:
    engines/fullpipe/motion.cpp
    engines/fullpipe/motion.h
    engines/fullpipe/scenes/scene04.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index bea9bcd..b96d2d8 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -337,7 +337,7 @@ void MctlLadder::addObject(StaticANIObject *obj) {
 
 		if (initMovement(obj, movement)) {
 			_mgm.addItem(obj->_id);
-			_movements.push_back(movement);
+			_ladmovements.push_back(movement);
 		} else {
 			delete movement;
 		}
@@ -347,7 +347,7 @@ void MctlLadder::addObject(StaticANIObject *obj) {
 int MctlLadder::findObjectPos(StaticANIObject *obj) {
 	int res = -1;
 
-	for (Common::List<MctlLadderMovement *>::iterator it = _movements.begin(); it != _movements.end(); ++it, ++res)
+	for (Common::List<MctlLadderMovement *>::iterator it = _ladmovements.begin(); it != _ladmovements.end(); ++it, ++res)
 		if ((*it)->objId == obj->_id)
 			break;
 
@@ -401,12 +401,12 @@ bool MctlLadder::initMovement(StaticANIObject *ani, MctlLadderMovement *movement
 void MctlLadder::freeItems() {
 	_mgm.clear();
 
-	for (Common::List<MctlLadderMovement *>::iterator it = _movements.begin(); it != _movements.end(); ++it) {
+	for (Common::List<MctlLadderMovement *>::iterator it = _ladmovements.begin(); it != _ladmovements.end(); ++it) {
 		delete (*it)->movVars;
 		delete [] (*it)->staticIds;
 	}
 
-	_movements.clear();
+	_ladmovements.clear();
 }
 
 MessageQueue *MctlLadder::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 2b40791..b7e96f61 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -210,7 +210,7 @@ public:
 	int _height;
 	int _ladder_field_20;
 	int _ladder_field_24;
-	Common::List<MctlLadderMovement *> _movements;
+	Common::List<MctlLadderMovement *> _ladmovements;
 	MGM _mgm;
 
 public:
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index b47553e..0a69335 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -324,15 +324,15 @@ void sceneHandler04_walkClimbLadder(ExCommand *ex) {
 	g_vars->scene04_ladder->addObject(g_fp->_aniMan);
 
 	if (g_vars->scene04_soundPlaying) {
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpStart = MV_MAN_STARTLADDER2;
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpGo = MV_MAN_GOLADDER2;
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpStop = MV_MAN_STOPLADDER2;
-		g_vars->scene04_ladder->_movements.front()->staticIds[2] = ST_MAN_GOLADDER2;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpStart = MV_MAN_STARTLADDER2;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpGo = MV_MAN_GOLADDER2;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpStop = MV_MAN_STOPLADDER2;
+		g_vars->scene04_ladder->_ladmovements.front()->staticIds[2] = ST_MAN_GOLADDER2;
 	} else {
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpStart = MV_MAN_STARTLADDER;
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpGo = MV_MAN_GOLADDER;
-		g_vars->scene04_ladder->_movements.front()->movVars->varUpStop = MV_MAN_STOPLADDER;
-		g_vars->scene04_ladder->_movements.front()->staticIds[2] = ST_MAN_GOLADDER;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpStart = MV_MAN_STARTLADDER;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpGo = MV_MAN_GOLADDER;
+		g_vars->scene04_ladder->_ladmovements.front()->movVars->varUpStop = MV_MAN_STOPLADDER;
+		g_vars->scene04_ladder->_ladmovements.front()->staticIds[2] = ST_MAN_GOLADDER;
 	}
 
 	g_fp->_aniMan->_priority = 12;


Commit: 7227d723a40080c0d65ec0a5cd0f37b6f480ec37
    https://github.com/scummvm/scummvm/commit/7227d723a40080c0d65ec0a5cd0f37b6f480ec37
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-01T16:49:41+03:00

Commit Message:
FULLPIPE: Started implmentation of MctlLadder::doWalkTo()

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index b96d2d8..a427ec7 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;






More information about the Scummvm-git-logs mailing list