[Scummvm-cvs-logs] scummvm master -> 3ca8f8c3a245a08aebc1ae9d5ece4c916ee5f674

sev- sev at scummvm.org
Sat Jan 4 01:02:17 CET 2014


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

Summary:
8725a3a6a6 FULLPIPE: Fix crahs in Floaters::init()
bb94a1a839 FULLPIPE: Simplify code in scene12
3ca8f8c3a2 FULLPIPE: More work on MovGraph2::genMovement()


Commit: 8725a3a6a67987fadd11e03d75a22845fd528c8c
    https://github.com/scummvm/scummvm/commit/8725a3a6a67987fadd11e03d75a22845fd528c8c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-03T15:20:39-08:00

Commit Message:
FULLPIPE: Fix crahs in Floaters::init()

Changed paths:
    engines/fullpipe/floaters.cpp



diff --git a/engines/fullpipe/floaters.cpp b/engines/fullpipe/floaters.cpp
index b405e33..c1c55fd 100644
--- a/engines/fullpipe/floaters.cpp
+++ b/engines/fullpipe/floaters.cpp
@@ -77,8 +77,12 @@ void Floaters::init(GameVar *var) {
 		int idx = 0;
 
 		while (sub) {
-			_array1[idx]->val1 = sub->_subVars->_value.intValue;
-			_array1[idx]->val2 = sub->_subVars->_nextVarObj->_value.intValue;
+			FloaterArray1 *f = new FloaterArray1;
+
+			f->val1 = sub->_subVars->_value.intValue;
+			f->val2 = sub->_subVars->_nextVarObj->_value.intValue;
+
+			_array1.push_back(f);
 
 			idx++;
 			sub = sub->_nextVarObj;


Commit: bb94a1a839b17b78cef7212b726adcd652a042a2
    https://github.com/scummvm/scummvm/commit/bb94a1a839b17b78cef7212b726adcd652a042a2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-03T15:27:34-08:00

Commit Message:
FULLPIPE: Simplify code in scene12

Changed paths:
    engines/fullpipe/scenes/scene12.cpp



diff --git a/engines/fullpipe/scenes/scene12.cpp b/engines/fullpipe/scenes/scene12.cpp
index 65f50b4..0295efc 100644
--- a/engines/fullpipe/scenes/scene12.cpp
+++ b/engines/fullpipe/scenes/scene12.cpp
@@ -42,7 +42,7 @@ void scene12_initScene(Scene *sc) {
 	g_vars->scene12_fly = g_fp->getObjectState(sO_Fly_12);
 
 	if (g_vars->scene12_fly)
-		g_vars->scene12_flyCountdown = 600 * g_fp->_rnd->getRandomNumber(32767) / 0x7fff + 600;
+		g_vars->scene12_flyCountdown = g_fp->_rnd->getRandomNumber(600) + 600;
 
 	g_fp->setObjectState(sO_Fly_12, g_fp->_rnd->getRandomNumber(1));
 }


Commit: 3ca8f8c3a245a08aebc1ae9d5ece4c916ee5f674
    https://github.com/scummvm/scummvm/commit/3ca8f8c3a245a08aebc1ae9d5ece4c916ee5f674
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-01-03T16:01:40-08:00

Commit Message:
FULLPIPE: More work on MovGraph2::genMovement()

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 6e4c1b6..0e11d66 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1399,88 +1399,74 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
 
 	Common::Point point;
 
-	v13 = info->pt2.y - info->pt1.y - my2 - my1;
-	y = info->pt2.y - info->pt1.y - my2 - my1;
-	x = info->pt2.x - mx2 - mx1 - info->pt1.x;
-	v10 = x;
-	_mgm->calcLength(&point, _items2[info->field_0].subItems[info->subIndex].walk[1].mov, x, y, &v65, &a2, info->_flags & 1);
-	v17 = point.x;
-	x1 = point.x;
-	v18 = point.y;
-	y1 = v18;
+	int y = info->pt2.y - info->pt1.y - my2 - my1;
+	int x = info->pt2.x - info->pt1.x - mx2 - mx1;
+	int a2;
+
+	_mgm->calcLength(&point, _items2[info->field_0].subItems[info->subIndex].walk[1].mov, x, y, &mgmLen, &a2, info->_flags & 1);
+
+	int x1 = point.x;
+	int y1 = point.y;
 
 	if (!(info->flags & 1)) {
 		if (info->subIndex == 1 || info->subIndex == 0) {
 			a2 = -1;
-			v17 = v65 * _items2[info->field_0].subItems[info->subIndex].walk[1].mx;
-			v10 = v17;
-			x1 = v17;
-			x = v17;
-			info->pt2.x = v17 + info->pt1.x + mx1 + mx2;
+			x1 = mgmLen * _items2[info->field_0].subItems[info->subIndex].walk[1].mx;
+			x = x1;
+			info->pt2.x = x1 + info->pt1.x + mx1 + mx2;
 		}
 	}
 
 	if (!(info->flags & 1)) {
 		if (info->subIndex == 2 || info->subIndex == 3) {
 			a2 = -1;
-			v18 = v65 * _items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].my;
-			v26 = ;
-			y1 = v18;
-			v13 = v18;
-			info->pt2.y = v18 + info->pt1.y + my1 + my2;
+			y1 = mgmLen * _items2[info->field_0].subItems[info->subIndex].walk[1].my;
+			y = y1;
+			info->pt2.y = y1 + info->pt1.y + my1 + my2;
 		}
 	}
-	cnt = 0;
-	v60 = 0;
+
+	int cntX = 0;
+	int cntY = 0;
+
 	if (!(info->flags & 2)) {
-		cnt = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].mov, -1, 1);
-		v27 = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].mov, -1, 2);
-		v18 = y1;
-		v17 = x1;
-		v10 = x;
-		v60 = v27;
+		cntX = Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[0].mov, -1, 1);
+		cntY = Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[0].mov, -1, 2);
 	}
-	if (v65 > 1) {
-		v28 = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].mov, -1, 1);
-		cnt += (v65 - 1) * v28;
-		v29 = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].mov, -1, 2);
-		v17 = x1;
-		v10 = x;
-		v60 += (v65 - 1) * v29;
-		v18 = y1;
+
+	if (mgmLen > 1) {
+		cntX += (mgmLen - 1) * Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[1].mov, -1, 1);
+		cntY += (mgmLen - 1) * Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[1].mov, -1, 2);
 	}
-	if (v65 > 0) {
-		cnt += Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].mov, a2, 1);
-		v30 = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].mov, a2, 2);
-		v17 = x1;
-		v10 = x;
-		v60 += v30;
-		v18 = y1;
+
+	if (mgmLen > 0) {
+		cntX += Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[1].mov, a2, 1);
+		cntY += Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[1].mov, a2, 2);
 	}
+
 	if (!(info->flags & 4)) {
-		cnt += Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[2].mov, -1, 1);
-		v31 = Movement_countPhasesWithFlag(this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[2].mov, -1, 2);
-		v17 = x1;
-		v10 = x;
-		v60 += v31;
-		v18 = y1;
+		cntX += Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[2].mov, -1, 1);
+		cntY += Movement_countPhasesWithFlag(_items2[info->field_0].subItems[info->subIndex].walk[2].mov, -1, 2);
 	}
-	v32 = v10 - v17;
-	v33 = v13 - v18;
-	x = v32;
-	v74 = v33;
-	if (cnt)
-		x1 = (signed __int64)((double)x / (double)cnt);
+
+	int dx1 = x - x1;
+	int dy1 = y - y1;
+
+	if (cntX)
+		x1 = (int)((double)dx1 / (double)cntX);
 	else
 		x1 = 0;
-	if (v60)
-		y1 = (signed __int64)((double)v74 / (double)v60);
+
+	if (cntY)
+		y1 = (int)((double)dy1 / (double)cntY);
 	else
 		y1 = 0;
-	v34 = v32 - cnt * x1;
-	v35 = v33 - v60 * y1;
+
+	int v34 = dx1 - cntX * x1;
+	int v35 = dy1 - cntY * y1;
+	int v72;
 	y2 = v34;
-	v76 = v35;
+
 	if (v34)
 		x2 = v34 / abs(v34);
 	else
@@ -1495,9 +1481,9 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
 
 	if (info->flags & 2) {
 		ex = new ExCommand(
-							_items2.m_pData[info->field_0].objectId,
+							_items2[info->field_0].objectId,
 							5,
-							_items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].movementId,
+							_items2[info->field_0].subItems[info->subIndex].walk[1].movementId,
 							info->pt1.x,
 							info->pt1.y,
 							0,
@@ -1508,15 +1494,14 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
 
 		ex->_field_14 = info->distance1;
 
-		ex->_keyCode = _items2.m_pData[info->field_0].obj->_okeyCode;
+		ex->_keyCode = _items2[info->field_0].obj->_okeyCode;
 		ex->_field_24 = 1;
 		ex->_excFlags |= 2;
 	} else {
-		ex = ExCommand_ctor(
-							 (ExCommand *)v61,
-							 LOWORD(this->items2.m_pData[info->field_0].objectId),
+		ex = new ExCommand(
+							 _items2[info->field_0].objectId,
 							 5,
-							 this->items2.m_pData[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].movementId,
+							 _items2[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].movementId,
 							 info->pt1.x,
 							 info->pt1.y,
 							 0,
@@ -1533,57 +1518,56 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
 		mq->addExCommandToEnd(ex);
 
 		ex = _mgm->buildExCommand2(
-								  _items2.m_pData[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].mov,
-								  _items2.m_pData[info->field_0].objectId,
+								  _items2[info->field_0].subItems[info->subIndex].walk[offsetof(MovGraph2Item, objectId)].mov,
+								  _items2[info->field_0].objectId,
 								  x1,
 								  y1,
 								  &x2,
 								  &y2,
 								  -1);
 		ex->_parId = mq->_id;
-		ex->_keyCode = _items2[info->field_0].obj->_okeyCode;
+		ex->_keyCode = _items2[info->field_0]->_okeyCode;
 	}
 
 	mq->addExCommandToEnd(ex);
-	v48 = v65;
-	v49 = 0;
-	for (i = 0; i < v65; ++i) {
-		if (v49 == v48 - 1)
-			v50 = a2;
+
+	for (i = 0; i < mgmLen; ++i) {
+		int par;
+
+		if (i == mgmLen - 1)
+			par = a2;
 		else
-			v50 = -1;
+			par = -1;
+
 		ex = _mgm->buildExCommand2(
-								  _items2.m_pData[info->field_0].subItems[info->subIndex].walk[1].mov,
-								  _items2.m_pData[info->field_0].objectId,
+								  _items2[info->field_0].subItems[info->subIndex].walk[1].mov,
+								  _items2[info->field_0].objectId,
 								  x1,
 								  y1,
 								  &x2,
 								  &y2,
-								  v50);
+								  par);
 		ex->_parId = mq->_id;
-		ex->_keyCode = _items2.m_pData[info->field_0].obj->_okeyCode;
+		ex->_keyCode = _items2[info->field_0].obj->_okeyCode;
 		mq->addExCommandToEnd(ex);
-
-		v48 = v65;
-		v49 = i + 1;
 	}
 
 	if (!(info->flags & 4)) {
 		ex = _mgm->buildExCommand2(
-								  _items2.m_pData[info->field_0].subItems[info->subIndex].walk[2].mov,
-								  _items2.m_pData[info->field_0].objectId,
+								  _items2[info->field_0].subItems[info->subIndex].walk[2].mov,
+								  _items2[info->field_0].objectId,
 								  x1,
 								  y1,
 								  &x2,
 								  &y2,
 								  -1);
 		ex->_parId = mq->_id;
-		ex->_keyCode = _items2.m_pData[info->field_0].obj->_okeyCode;
+		ex->_keyCode = _items2[info->field_0].obj->_okeyCode;
 
 		mq->addExCommandToEnd(ex);
 	}
 
-    ex = new ExCommand(_items2.m_pData[info->field_0].objectId, 5, -1, info->pt2.x, info->pt2.y, 0, 1, 0, 0, 0);
+    ex = new ExCommand(_items2[info->field_0].objectId, 5, -1, info->pt2.x, info->pt2.y, 0, 1, 0, 0, 0);
 	ex->_field_14 = info->distance2;
 
 	ex->_keyCode = _items[info->field_0].obj->_okeyCode;
@@ -1595,6 +1579,8 @@ MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
 	return mq;
 #endif
 
+	warning("STUB: MovGraph2::genMovement()");
+
 	return 0;
 }
 






More information about the Scummvm-git-logs mailing list