[Scummvm-cvs-logs] scummvm master -> 7a27be396350309b9a23b587d0a566603370e27a

sev- sev at scummvm.org
Tue May 6 06:11:51 CEST 2014


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

Summary:
7a27be3963 FULLPIPE: Implement MovGraph::shuffleTree()


Commit: 7a27be396350309b9a23b587d0a566603370e27a
    https://github.com/scummvm/scummvm/commit/7a27be396350309b9a23b587d0a566603370e27a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-05-06T07:10:50+03:00

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

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



diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index a4c5b0b..91950ba 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -818,6 +818,35 @@ Common::Array<MovArr *> *MovGraph::genMovArr(int x, int y, int *arrSize, int fla
 	return arr;
 }
 
+void MovGraph::shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2) {
+	if (lnk == lnk2) {
+		for (uint i = 0; i < tempObList1.size(); i++)
+			tempObList2.push_back(tempObList1[i]);
+
+		tempObList2.push_back(lnk);
+	} else {
+		lnk->_flags |= 0x80000000;
+
+		tempObList1.push_back(lnk);
+
+		for (ObList::iterator i = _links.begin(); i != _links.end(); ++i) {
+			MovGraphLink *l = (MovGraphLink *)*i;
+
+			if (l->_movGraphNode1 != lnk->_movGraphNode1) {
+				if (l->_movGraphNode2 != lnk->_movGraphNode1) {
+					if (l->_movGraphNode1 != lnk->_movGraphNode2 && l->_movGraphNode2 != lnk->_movGraphNode2)
+						continue;
+				}
+			}
+
+			if (!(l->_flags & 0xA0000000))
+				shuffleTree(l, lnk2, tempObList1, tempObList2);
+		}
+
+		lnk->_flags &= 0x7FFFFFFF;
+	}
+}
+
 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 13d96ae..e00447b 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -363,6 +363,7 @@ public:
 	MovGraphNode *calcOffset(int ox, int oy);
 	int getItemIndexByStaticAni(StaticANIObject *ani);
 	Common::Array<MovArr *> *genMovArr(int x, int y, int *arrSize, int flag1, int flag2);
+	void shuffleTree(MovGraphLink *lnk, MovGraphLink *lnk2, Common::Array<MovGraphLink *> &tempObList1, Common::Array<MovGraphLink *> &tempObList2);
 };
 
 class Movement;






More information about the Scummvm-git-logs mailing list