[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.35,1.36 actor.h,1.6,1.7

Max Horn fingolfin at users.sourceforge.net
Sun Dec 15 13:55:02 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv27538

Modified Files:
	actor.cpp actor.h 
Log Message:
disable actor dir intepolation for V7 games - it interfers with walk scripts; ensure the 'frame' variable is set; cleanup

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- actor.cpp	6 Dec 2002 08:14:22 -0000	1.35
+++ actor.cpp	15 Dec 2002 21:54:47 -0000	1.36
@@ -260,7 +260,12 @@
 
 	from = toSimpleDir(dirType, facing);
 	dir = remapDirection(newDirection, is_walking);
-	shouldInterpolate = (dir & 1024) ? true : false;
+	if (_vm->_features & GF_AFTER_V7)
+		// Direction interpolation interfers with walk scripts in Dig; they perform
+		// (much better) interpolation themselves.
+		shouldInterpolate = false;	
+	else
+		shouldInterpolate = (dir & 1024) ? true : false;
 	to = toSimpleDir(dirType, dir & 1023);
 	num = dirType ? 8 : 4;
 
@@ -302,7 +307,6 @@
 
 	direction = updateActorDirection(true);
 	if (!(moving & MF_IN_LEG) || facing != direction) {
-		// FIXME - frame is never set and thus always 0! See actor.h comment
 		if (walkFrame != frame || facing != direction) {
 			startWalkAnim(walkFrame == frame ? 2 : 1, direction);
 		}
@@ -410,6 +414,7 @@
 
 void Actor::startAnimActor(int f)
 {
+	frame = f;
 	if (_vm->_features & GF_NEW_COSTUMES) {
 		switch (f) {
 		case 1001:
@@ -456,7 +461,9 @@
 			f = talkFrame2;
 			break;
 		}
-
+		
+		assert(f != 0x3E);
+	
 		// FIXME: This is a hack to fix decapitation, which somehow occurs only on
 		// the standFrame (CHORE mode 3). We hack around this by simply using the
 		// initFrame instead. As far as it goes, I see no difference. Apart from
@@ -468,13 +475,9 @@
 			animProgress = 0;
 			cost.animCounter1 = 0;
 			needRedraw = true;
-
-			if (initFrame == f)
+			if (f == initFrame)
 				cost.reset();
-
-			if (f != 0x3E) {
-				_vm->cost_decodeData(this, f, (uint) - 1);
-			}
+			_vm->cost_decodeData(this, f, (uint) - 1);
 		}
 
 		needBgReset = true;
@@ -495,8 +498,8 @@
 
 	} else {
 
-		cmd = anim >> 2;
-		dir = oldDirToNewDir(anim & 3);
+		cmd = anim / 4;
+		dir = oldDirToNewDir(anim % 4);
 
 		// Convert into old cmd code
 		cmd = 0x3F - cmd + 2;
@@ -504,15 +507,15 @@
 	}
 
 	switch (cmd) {
-	case 2:
+	case 2:				// stop walking
 		stopActorMoving();
 		startAnimActor(standFrame);
 		break;
-	case 3:
+	case 3:				// change direction immediatly
 		moving &= ~MF_TURN;
 		setDirection(dir);
 		break;
-	case 4:
+	case 4:				// turn to new direction
 		turnToDirection(dir);
 		break;
 	default:
@@ -1205,20 +1208,22 @@
 	if (angle == -1)
 		angle = facing;
 
-/*FIXME: (yazoo): the walk script are buggy in dig causing
- * troubles while walking. It's disabled until I can
- * find a proper fix
- * note: walk scripts aren't required to make the game
- * work as usual */
-
-/*	int16 args[16];
-
+	/* FIXME: (yazoo/fingolfin): using the walk script is buggy in Dig,
+	 * troubles while walking. It's disabled until we can figure out how
+	 * to fix this properly.
+	 * Note: walk scripts aren't required to make the game
+	 * work as usual
+	 */
+#if 0
 	if (walk_script != 0) {
-		args[2] = angle;
+		int16 args[16];
 		args[0] = number;
 		args[1] = cmd;
+		args[2] = angle;
 		_vm->runScript(walk_script, 1, 0, args);
-	} else*/  {
+	} else
+#endif
+	{
 		switch (cmd) {
 		case 1:										/* start walk */
 			setDirection(angle);

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- actor.h	8 Dec 2002 16:14:28 -0000	1.6
+++ actor.h	15 Dec 2002 21:54:47 -0000	1.7
@@ -89,17 +89,7 @@
 	byte shadow_mode;
 	bool flip;
 	uint speedx, speedy;
-	
-	// FIXME: the "frame" field is never set, so it is always stays at 0. I am not sure
-	// if at some point in the past it was actually set (somebody wanna check?). There are
-	// two possibilities: either we just scratch this and hope all works fine, or we come
-	// up with a "correct" implementation.
-	// The actor.cpp code uses this to determine if the actor shows a walk animation.
-	// The script_v2.cpp code uses it for o6_kernelFunction:212.
-	// The save/load code (re)stores it.
-	// And debug.cpp prints it for debugging purposes.
 	byte frame;
-
 	byte walkbox;
 	byte animProgress, animSpeed;
 	int16 new_1, new_2;





More information about the Scummvm-git-logs mailing list