[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.22,1.23 actor.h,1.3,1.4 script_v2.cpp,1.40,1.41 saveload.cpp,1.15,1.16

Max Horn fingolfin at users.sourceforge.net
Tue Oct 22 17:23:08 CEST 2002


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

Modified Files:
	actor.cpp actor.h script_v2.cpp saveload.cpp 
Log Message:
Actor::frame is never set, this should be researched

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- actor.cpp	22 Oct 2002 11:47:45 -0000	1.22
+++ actor.cpp	23 Oct 2002 00:22:55 -0000	1.23
@@ -301,7 +301,7 @@
 
 	direction = updateActorDirection(true);
 	if (!(moving & MF_IN_LEG) || facing != direction) {
-		printf("walkFrame = %d, frame = %d\n", walkFrame, frame);
+		// FIXME - frame is never set and thus always 0! See actor.h comment
 		if (walkFrame != frame || facing != direction) {
 			startWalkAnim(walkFrame == frame ? 2 : 1, direction);
 		}
@@ -407,24 +407,24 @@
 	scaley = (byte)scale;
 }
 
-void Actor::startAnimActor(int frame)
+void Actor::startAnimActor(int f)
 {
 	if (_vm->_features & GF_NEW_COSTUMES) {
-		switch (frame) {
+		switch (f) {
 		case 1001:
-			frame = initFrame;
+			f = initFrame;
 			break;
 		case 1002:
-			frame = walkFrame;
+			f = walkFrame;
 			break;
 		case 1003:
-			frame = standFrame;
+			f = standFrame;
 			break;
 		case 1004:
-			frame = talkFrame1;
+			f = talkFrame1;
 			break;
 		case 1005:
-			frame = talkFrame2;
+			f = talkFrame2;
 			break;
 		}
 
@@ -432,27 +432,27 @@
 			animProgress = 0;
 			needRedraw = true;
 			needBgReset = true;
-			if (frame == initFrame)
+			if (f == initFrame)
 				cost.reset();
-			_vm->akos_decodeData(this, frame, (uint) - 1);
+			_vm->akos_decodeData(this, f, (uint) - 1);
 		}
 
 	} else {
-		switch (frame) {
+		switch (f) {
 		case 0x38:
-			frame = initFrame;
+			f = initFrame;
 			break;
 		case 0x39:
-			frame = walkFrame;
+			f = walkFrame;
 			break;
 		case 0x3A:
-			frame = standFrame;
+			f = standFrame;
 			break;
 		case 0x3B:
-			frame = talkFrame1;
+			f = talkFrame1;
 			break;
 		case 0x3C:
-			frame = talkFrame2;
+			f = talkFrame2;
 			break;
 		}
 
@@ -461,11 +461,11 @@
 			cost.animCounter1 = 0;
 			needRedraw = true;
 
-			if (initFrame == frame)
+			if (initFrame == f)
 				cost.reset();
 
-			if (frame != 0x3E) {
-				_vm->cost_decodeData(this, frame, (uint) - 1);
+			if (f != 0x3E) {
+				_vm->cost_decodeData(this, f, (uint) - 1);
 			}
 		}
 

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- actor.h	22 Oct 2002 11:33:51 -0000	1.3
+++ actor.h	23 Oct 2002 00:22:55 -0000	1.4
@@ -89,7 +89,17 @@
 	byte shadow_mode;
 	bool flip;
 	uint speedx, speedy;
-	byte frame; // FIXME - it seems this is never set?
+	
+	// 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 mask;	// FIXME: This field is *NOT* used - remove next time save game format changes
 	byte animProgress, animSpeed;

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- script_v2.cpp	22 Oct 2002 11:48:24 -0000	1.40
+++ script_v2.cpp	23 Oct 2002 00:22:55 -0000	1.41
@@ -3071,6 +3071,7 @@
 		break;
 	case 212:
 		a = derefActorSafe(args[1], "o6_kernelFunction:212");
+		// FIXME - frame is never set and thus always 0! See actor.h comment
 		push(a->frame);
 		break;
 	case 215:

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- saveload.cpp	15 Oct 2002 06:53:41 -0000	1.15
+++ saveload.cpp	23 Oct 2002 00:22:55 -0000	1.16
@@ -266,9 +266,10 @@
 		MKLINE(Actor, cost.animCounter1, sleUint16),
 		MKLINE(Actor, cost.animCounter2, sleByte),
 		MKARRAY(Actor, palette[0], sleByte, 64),
-		MKLINE(Actor, mask, sleByte),
+		MKLINE(Actor, mask, sleByte), // FIXME: see actor.h comment
 		MKLINE(Actor, shadow_mode, sleByte),
 		MKLINE(Actor, visible, sleByte),
+		// FIXME - frame is never set and thus always 0! See actor.h comment
 		MKLINE(Actor, frame, sleByte),
 		MKLINE(Actor, animSpeed, sleByte),
 		MKLINE(Actor, animProgress, sleByte),





More information about the Scummvm-git-logs mailing list