[Scummvm-cvs-logs] scummvm master -> 403b68e84d673705c179f3cb616bd0c45dab8508

sev- sev at scummvm.org
Mon May 26 08:07:31 CEST 2014


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

Summary:
09163f5878 FULLPIPE: More work on MovGraph::sub1()
120edd9434 FULLPIPE: Finish MovGraph::sub1() implementation
82f4e71d56 FULLPIPE: Implement MovGraph::setEnds()
2cc7a81846 FULLPIPE: Implement MovGraphItem::free()
403b68e84d FULLPIPE: Started MovGraph::method28() implementation


Commit: 09163f58780ea233321e9ed06bade7ebc63bf33b
    https://github.com/scummvm/scummvm/commit/09163f58780ea233321e9ed06bade7ebc63bf33b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-26T08:44:28+03:00

Commit Message:
FULLPIPE: More work on MovGraph::sub1()

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index ad86805..06c37f4 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -817,7 +817,7 @@ MessageQueue *MovGraph::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int
 	return 0;
 }
 
-MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x1, int y1, int a8, int flag1) {
+MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x1, int y1, int stid2, int flag1) {
 #if 0
 	PicAniInfo picinfo;
 
@@ -837,46 +837,38 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 		return 0;
 	}
 
-	v13 = _callback1(ani, movitem, rescount);
-	v14 = MovGraph_getItemIndexByStaticAni(this, ani);
-	v15 = v14 << 6;
+	MessageQueue *res = 0;
+
+	MovArr *goal = _callback1(ani, movitem, rescount);
+	int idx = getItemIndexByStaticAni(ani);
 	v16 = 0;
 
-	movgitem = _items[v14];
+	movgitem = _items[idx];
 	v18 = movgitem->count;
 
 	if (v18 > 0) {
 		v19 = movgitem->movitems;
-		while (v19->movarr != v13) {
+		while (v19->movarr != goal) {
 			++v16;
 			++v19;
 			if (v16 >= v18)
-				goto LABEL_6;
+				break;
 		}
-		v21 = v16;
-		v22 = movgitem->movitems[v21].movarr;
-		v23 = movgitem->movarr._movSteps;
-		movarr = movgitem->movitems[v21].movarr;
 
-		if (v23)
-			CObjectFree(v23);
-
-		memcpy((char *)&this->_items->movarr + v15, v22, 0x20u);
-		*(MovStep **)((char *)&this->_items->movarr._movSteps + v15) = (MovStep *)operator new(8 * movarr->_movStepCount);
-		memcpy(*(void **)((char *)&this->_items->movarr._movSteps + v15), movarr->_movSteps, 8 * movarr->_movStepCount);
-		*(int *)((char *)&this->_items->movarr._afield_8 + v15) = -1;
-		*(MovGraphLink **)((char *)&this->_items->movarr._link + v15) = 0;
-		v24 = fillMGMinfo(*(StaticANIObject **)((char *)&this->_items->ani + v15), (MovArr *)((char *)&this->_items->movarr + v15), a8);
+		if (v16 < v18) {
+			movgitem->movarr._movSteps.clear();
+			_items[idx]->movarr = movgitem->movitems[v16].movarr;
+			_items[idx]->movarr._movSteps = movgitem->movitems[v16].movarr->_movSteps;
+			_items[idx]->movarr._afield_8 = -1;
+			_items[idx]->movarr._link = 0;
 
-		result = v24;
-	} else {
-	LABEL_6:
-		result = 0;
+			res = fillMGMinfo(_items[idx]->ani, _items[idx]->movarr, stid2);
+		}
 	}
 
 	ani->setPicAniInfo(&picinfo);
 
-	return result;
+	return res;
 #endif
 	warning("STUB: *MovGraph::sub1()");
 


Commit: 120edd94349b4a9f7a5a294b37504edee4a39c41
    https://github.com/scummvm/scummvm/commit/120edd94349b4a9f7a5a294b37504edee4a39c41
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-26T08:44:28+03:00

Commit Message:
FULLPIPE: Finish MovGraph::sub1() implementation

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 06c37f4..2564096 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -818,7 +818,6 @@ MessageQueue *MovGraph::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int
 }
 
 MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x1, int y1, int stid2, int flag1) {
-#if 0
 	PicAniInfo picinfo;
 
 	ani->getPicAniInfo(&picinfo);
@@ -829,9 +828,9 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 
 	int rescount;
 
-	MovItem *movitem = method28(ani, x1, y1, flag1, &rescount);
+	Common::Array<MovItem *> *movitems = method28(ani, x1, y1, flag1, &rescount);
 
-	if (!movitem) {
+	if (!movitems) {
 		ani->setPicAniInfo(&picinfo);
 
 		return 0;
@@ -839,40 +838,27 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x
 
 	MessageQueue *res = 0;
 
-	MovArr *goal = _callback1(ani, movitem, rescount);
+	MovArr *goal = _callback1(ani, movitems, rescount);
 	int idx = getItemIndexByStaticAni(ani);
-	v16 = 0;
 
-	movgitem = _items[idx];
-	v18 = movgitem->count;
+	MovGraphItem *movgitem = _items[idx];
+	int cnt = movgitem->count;
 
-	if (v18 > 0) {
-		v19 = movgitem->movitems;
-		while (v19->movarr != goal) {
-			++v16;
-			++v19;
-			if (v16 >= v18)
-				break;
-		}
-
-		if (v16 < v18) {
+	for (int nidx = 0; nidx < cnt; nidx++) {
+		if ((*movgitem->movitems)[nidx]->movarr == goal) {
 			movgitem->movarr._movSteps.clear();
-			_items[idx]->movarr = movgitem->movitems[v16].movarr;
-			_items[idx]->movarr._movSteps = movgitem->movitems[v16].movarr->_movSteps;
+			_items[idx]->movarr = *(*movgitem->movitems)[nidx]->movarr;
+			_items[idx]->movarr._movSteps = (*movgitem->movitems)[nidx]->movarr->_movSteps;
 			_items[idx]->movarr._afield_8 = -1;
 			_items[idx]->movarr._link = 0;
 
-			res = fillMGMinfo(_items[idx]->ani, _items[idx]->movarr, stid2);
+			res = fillMGMinfo(_items[idx]->ani, &_items[idx]->movarr, stid2);
 		}
 	}
 
 	ani->setPicAniInfo(&picinfo);
 
 	return res;
-#endif
-	warning("STUB: *MovGraph::sub1()");
-
-	return 0;
 }
 
 MessageQueue *MovGraph::fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int staticsId) {


Commit: 82f4e71d5604202ef364fb225f0dc7b527bd39c2
    https://github.com/scummvm/scummvm/commit/82f4e71d5604202ef364fb225f0dc7b527bd39c2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-26T08:44:28+03:00

Commit Message:
FULLPIPE: Implement MovGraph::setEnds()

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



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 2564096..9f34c8f 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1296,6 +1296,28 @@ bool MovGraph::calcChunk(int idx, int x, int y, MovArr *arr, int a6) {
 	return res;
 }
 
+void MovGraph::setEnds(MovStep *step1, MovStep *step2) {
+	if (step1->link->_movGraphNode1 == step2->link->_movGraphNode2) {
+		step1->sfield_0 = 1;
+		step2->sfield_0 = 1;
+
+		return;
+	}
+
+	if (step1->link->_movGraphNode1 == step2->link->_movGraphNode1) {
+		step1->sfield_0 = 1;
+		step2->sfield_0 = 0;
+	} else {
+		step1->sfield_0 = 0;
+
+		if (step1->link->_movGraphNode2 != step2->link->_movGraphNode1) {
+			step2->sfield_0 = 1;
+		} else {
+			step2->sfield_0 = 0;
+		}
+	}
+}
+
 int MovGraph2::getItemIndexByGameObjectId(int objectId) {
 	for (uint i = 0; i < _items2.size(); i++)
 		if (_items2[i]->_objectId == objectId)
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 2765cc3..b728831 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -376,6 +376,7 @@ public:
 	bool calcChunk(int idx, int x, int y, MovArr *arr, int a6);
 	MessageQueue *sub1(StaticANIObject *ani, int x, int y, int a5, int x1, int y1, int a8, int a9);
 	MessageQueue *fillMGMinfo(StaticANIObject *ani, MovArr *movarr, int staticsId);
+	void setEnds(MovStep *step1, MovStep *step2);
 };
 
 class Movement;


Commit: 2cc7a8184627415129f37eba02ad66f04cc4b20e
    https://github.com/scummvm/scummvm/commit/2cc7a8184627415129f37eba02ad66f04cc4b20e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-26T08:53:03+03:00

Commit Message:
FULLPIPE: Implement MovGraphItem::free()

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 9f34c8f..79bb026 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -516,7 +516,14 @@ MovGraphItem::MovGraphItem() {
 }
 
 void MovGraphItem::free() {
-	warning("STUB: MovGraphItem::free()");
+	for (uint i = 0; i < movitems->size(); i++) {
+		(*movitems)[i]->movarr->_movSteps.clear();
+		delete (*movitems)[i]->movarr;
+	}
+
+	delete movitems;
+
+	movitems = 0;
 }
 
 int MovGraph_messageHandler(ExCommand *cmd);


Commit: 403b68e84d673705c179f3cb616bd0c45dab8508
    https://github.com/scummvm/scummvm/commit/403b68e84d673705c179f3cb616bd0c45dab8508
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-26T09:06:44+03:00

Commit Message:
FULLPIPE: Started MovGraph::method28() implementation

Changed paths:
    engines/fullpipe/motion.cpp



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 79bb026..3a7551f 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -597,6 +597,74 @@ void MovGraph::freeItems() {
 	_items.clear();
 }
 Common::Array<MovItem *> *MovGraph::method28(StaticANIObject *ani, int x, int y, int flag1, int *rescount) {
+#if 0
+	*rescount = 0;
+
+	if (_itemsCount <= 0)
+		return 0;
+
+	int idx = 0;
+
+	while (_items[idx]->ani != ani) {
+		idx++;
+
+		if (idx >= _itemsCount)
+			return 0;
+	}
+	_items[idx]->free();
+
+	calcNodeDistancesAndAngles();
+
+	_items[idx].movarr._movSteps.clear();
+
+	v15 = ani->_oy;
+	point1.x = ani->_ox;
+	point1.y = v15;
+
+	if (!MovGraph_calcChunk(this, idx, ani->_ox, v15, &_items[idx]->movarr, 0))
+		MovGraph_findClosestLink(this, idx, &point1, &_items[idx]->movarr);
+
+	_items[idx]->count = 0;
+
+	delete _items[idx]->movitems;
+	_items[idx]->movitems = 0;
+
+	v18 = (int)MovGraph_genMovArr(this, x, y, &arrSize, flag1, 0);
+	v26 = v18;
+	if (v18) {
+		flag1 = 0;
+		if (arrSize > 0) {
+			v19 = v18;
+			x = v18;
+			do {
+				int sz;
+				v20 = MovGraph_calcMovItems(this, _items[idx]->movarr, (MovArr *)v19, &sz);
+				Memory = v20;
+				if (sz > 0) {
+					_items[idx]->movitems = MovGraph_arr16_realloc(_items[idx]->movitems, _items[idx]->count, sz + _items[idx]->count);
+					memcpy(_items[idx]->movitems[_items[idx]->count], v20, 16 * sz);
+					_items[idx]->count += sz;
+					CObjectFree(Memory);
+					v19 = x;
+				}
+				v19 += 32;
+				v22 = __OFSUB__(flag1 + 1, arrSize);
+				v21 = flag1++ + 1 - arrSize < 0;
+				x = v19;
+			} while ( v21 ^ v22 );
+			v18 = v26;
+		}
+		CObjectFree((void *)v18);
+	}
+
+	if (_items[idx]->count) {
+		*rescount = _items[idx]->count;
+
+		return _items[idx]->movitems;
+	}
+
+	return 0;
+#endif
 	warning("STUB: MovGraph::method28()");
 
 	return 0;






More information about the Scummvm-git-logs mailing list