[Scummvm-cvs-logs] CVS: scummvm script_v1.cpp,1.104,1.105 actor.cpp,1.63,1.64

Max Horn fingolfin at users.sourceforge.net
Sat May 11 07:56:02 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv8591

Modified Files:
	script_v1.cpp actor.cpp 
Log Message:
once more changed the face direction calculation; allows to remove MI2 bridge hack in script_v1.cpp

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- script_v1.cpp	11 May 2002 06:51:11 -0000	1.104
+++ script_v1.cpp	11 May 2002 14:55:03 -0000	1.105
@@ -980,14 +980,6 @@
 
 void Scumm::o5_endCutscene()
 {
-  // FIXME MI2: wrong direction/levitation of G. on the bridge
-	if ((_gameId == GID_MONKEY2) && (_currentRoom == 7) &&
-		(vm.slot[_currentScript].number == 203)) {
-			Actor *a = derefActor(1);
-			if (a->x == 571)
-				a->facing = 90;
-	}
-
 	endCutscene();
 }
 

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- actor.cpp	10 May 2002 21:35:53 -0000	1.63
+++ actor.cpp	11 May 2002 14:55:03 -0000	1.64
@@ -175,7 +175,8 @@
 {
 	int specdir;
 	byte flags;
-	byte dirflag;
+	bool flipX;
+	bool flipY;
 	
 	if (!a->ignoreBoxes) {
 		specdir = _extraBoxFlags[a->walkbox];
@@ -189,24 +190,32 @@
 
 		flags = getBoxFlags(a->walkbox);
 
-		dirflag = ((a->walkdata.XYFactor > 0) ? 1 : 0) |
-			((a->walkdata.YXFactor > 0) ? 2 : 0);
+		flipX = (a->walkdata.XYFactor > 0);
+		flipY = (a->walkdata.YXFactor > 0);
 
-		if ((flags & 8) || getClass(a->number, 0x1E)) {
+		// Check for X-Flip
+		if ((flags & 0x08) || getClass(a->number, 0x1E)) {
 			dir = 360 - dir;
-			dirflag ^= 1;
+			flipX = !flipX;
 		}
 
+		// Check for Y-Flip
 		if ((flags & 0x10) || getClass(a->number, 0x1D)) {
 			dir = 180 - dir;
-			dirflag ^= 2;
+			flipY = !flipY;
 		}
 
 		switch (flags & 7) {
 		case 1:
-			return (dirflag & 1) ? 90 : 270;
+			if (a->moving&~MF_TURN)				// Actor is walking
+				return flipX ? 90 : 270;
+			else								// Actor is standing/turning
+				return (dir == 90) ? 90 : 270;
 		case 2:
-			return (dirflag & 2) ? 180 : 0;
+			if (a->moving&~MF_TURN)				// Actor is walking
+				return flipY ? 180 : 0;
+			else								// Actor is standing/turning
+				return (dir == 0) ? 0 : 180;
 		case 3:
 			return 270;
 		case 4:
@@ -253,7 +262,9 @@
 	} else
 		from = to;
 	
-	return fromSimpleDir(dirType, from & (num - 1));
+	dir = fromSimpleDir(dirType, from & (num - 1));
+
+	return dir;
 }
 
 void Scumm::setActorBox(Actor * a, int box)





More information about the Scummvm-git-logs mailing list