[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.58,1.59 script.cpp,1.56,1.57 scumm.h,1.155,1.156 script_v2.cpp,1.56,1.57 scummvm.cpp,1.145,1.146

Max Horn fingolfin at users.sourceforge.net
Fri May 10 06:46:07 CEST 2002


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

Modified Files:
	actor.cpp script.cpp scumm.h script_v2.cpp scummvm.cpp 
Log Message:
renamed fixActorDirection to setActorDirection; fixed a bug causing wrong actor directions

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- actor.cpp	1 May 2002 10:48:09 -0000	1.58
+++ actor.cpp	10 May 2002 13:45:32 -0000	1.59
@@ -424,7 +424,7 @@
 	}
 }
 
-void Scumm::fixActorDirection(Actor * a, int direction)
+void Scumm::setActorDirection(Actor * a, int direction)
 {
 	uint mask;
 	int i;
@@ -433,7 +433,9 @@
 	if (a->facing == direction)
 		return;
 
-	a->facing = direction;
+	// Make sure the direction is between 0 and 359 degree.
+	// We add 360 to be able to cope with negative directions.
+	a->facing = (direction+360) % 360;
 
 	if (a->costume == 0)
 		return;
@@ -740,12 +742,11 @@
 	} else {
 		switch (cmd) {
 		case 1:										/* start walk */
-			//a->facing = angle;
-			fixActorDirection(a, angle);
+			setActorDirection(a, angle);
 			startAnimActor(a, a->walkFrame);
 			break;
 		case 2:										/* change dir only */
-			fixActorDirection(a, angle);
+			setActorDirection(a, angle);
 			break;
 		case 3:										/* stop walk */
 			turnToDirection(a, angle);
@@ -775,7 +776,7 @@
 		if (a->moving & 4) {
 			j = updateActorDirection(a);
 			if (a->facing != j)
-				fixActorDirection(a, j);
+				setActorDirection(a, j);
 			else
 				a->moving = 0;
 			return;
@@ -1361,7 +1362,7 @@
 	if (a->moving & 4) {
 		new_dir = updateActorDirection(a);
 		if (a->facing != new_dir) {
-			fixActorDirection(a, new_dir);
+			setActorDirection(a, new_dir);
 			return;
 		}
 		a->moving = 0;

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- script.cpp	6 May 2002 17:46:32 -0000	1.56
+++ script.cpp	10 May 2002 13:45:32 -0000	1.57
@@ -910,7 +910,7 @@
 			break;
 		case 3:
 			a->moving &= ~4;
-			fixActorDirection(a, dir);
+			setActorDirection(a, dir);
 			break;
 		case 4:
 			turnToDirection(a, dir);
@@ -936,7 +936,7 @@
 			break;
 		case 0x3E:
 			a->moving &= ~4;
-			fixActorDirection(a, oldDirToNewDir(dir));
+			setActorDirection(a, oldDirToNewDir(dir));
 			break;
 		case 0x3D:
 			turnToDirection(a, oldDirToNewDir(dir));

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -d -r1.155 -r1.156
--- scumm.h	7 May 2002 18:44:34 -0000	1.155
+++ scumm.h	10 May 2002 13:45:32 -0000	1.156
@@ -1066,7 +1066,7 @@
 	void startAnimActorEx(Actor *a, int frame, int direction);
 	int getProgrDirChange(Actor *a, int mode);
 	void initActorCostumeData(Actor *a);
-	void fixActorDirection(Actor *a, int direction);
+	void setActorDirection(Actor *a, int direction);
 
 	int getActorXYPos(Actor *a);
 	void adjustActorPos(Actor *a);	

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v2.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- script_v2.cpp	5 May 2002 20:04:25 -0000	1.56
+++ script_v2.cpp	10 May 2002 13:45:32 -0000	1.57
@@ -2040,7 +2040,7 @@
 		break;
 	case 230:										/* set direction */
 		a->moving &= ~4;
-		fixActorDirection(a, pop());
+		setActorDirection(a, pop());
 		break;
 	case 231:										/* turn to direction */
 		turnToDirection(a, pop());

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- scummvm.cpp	8 May 2002 09:09:39 -0000	1.145
+++ scummvm.cpp	10 May 2002 13:45:32 -0000	1.146
@@ -476,7 +476,7 @@
 						_currentRoom);
 		getObjectXYPos(objectNr);
 		putActor(a, _xPos, _yPos, _currentRoom);
-		fixActorDirection(a, _dir + 180);
+		setActorDirection(a, _dir + 180);
 		a->moving = 0;
 	}
 





More information about the Scummvm-git-logs mailing list