[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.106,1.107 isomap.cpp,1.35,1.36

Andrew Kurushin h00ligan at users.sourceforge.net
Sat Feb 26 10:09:56 CET 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10559

Modified Files:
	actor.cpp isomap.cpp 
Log Message:
fix iso mode object draw order

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- actor.cpp	26 Feb 2005 17:37:05 -0000	1.106
+++ actor.cpp	26 Feb 2005 18:06:54 -0000	1.107
@@ -46,10 +46,26 @@
 namespace Saga {
 
 static int commonObjectCompare(const CommonObjectDataPointer& obj1, const CommonObjectDataPointer& obj2) {
-	if (obj1->location.y == obj2->location.y) {
+	int p1 = obj1->location.y - obj1->location.z;
+	int p2 = obj2->location.y - obj2->location.z;
+	if (p1 == p2) {
 		return 0;
 	} else {
-		if (obj1->location.y < obj2->location.y) {
+		if (p1 < p2) {
+			return -1;
+		} else {
+			return 1;
+		}
+	}
+}
+
+static int tileCommonObjectCompare(const CommonObjectDataPointer& obj1, const CommonObjectDataPointer& obj2) {
+	int p1 = -obj1->location.u() - obj1->location.v() - obj1->location.z;
+	int p2 = -obj2->location.u() - obj2->location.v() - obj2->location.z;
+	if (p1 == p2) {
+		return 0;
+	} else {
+		if (p1 < p2) {
 			return -1;
 		} else {
 			return 1;
@@ -1166,6 +1182,13 @@
 	int i;
 	ActorData *actor;
 	ObjectData *obj;
+	CommonObjectOrderList::CompareFunction *compareFunction;
+
+	if (_vm->_scene->getFlags() & kSceneFlagISO) {
+		compareFunction = &tileCommonObjectCompare;
+	} else {
+		compareFunction = &commonObjectCompare;
+	}
 
 	_drawOrderList.clear();
 	for (i = 0; i < _actorsCount; i++) {
@@ -1173,7 +1196,7 @@
 		if (actor->disabled) continue;
 		if (actor->sceneNumber != _vm->_scene->currentSceneNumber()) continue;
 
-		_drawOrderList.pushBack(actor, commonObjectCompare);
+			_drawOrderList.pushBack(actor, compareFunction);
 
 		calcScreenPosition(actor);
 	}
@@ -1182,7 +1205,7 @@
 		obj = _objs[i];
 		if (obj->sceneNumber != _vm->_scene->currentSceneNumber()) continue;
 
-		_drawOrderList.pushBack(obj, commonObjectCompare);
+		_drawOrderList.pushBack(obj, compareFunction);
 
 		calcScreenPosition(obj);
 	}

Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- isomap.cpp	26 Feb 2005 17:37:16 -0000	1.35
+++ isomap.cpp	26 Feb 2005 18:06:55 -0000	1.36
@@ -1318,9 +1318,9 @@
 		bestV += normalDirTable[dir].v;
 	}
 
-	if (i > 64) {
+/*	if (i > 64) {
 		i = 64;
-	}
+	}*/
 	actor->walkStepsCount = i;
 	if (i) {	
 		if (actor->tileDirectionsAlloced < i) {





More information about the Scummvm-git-logs mailing list