[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.53,1.54 actor.h,1.10,1.11 akos.cpp,1.35,1.36 script_v8.cpp,2.94,2.95

Max Horn fingolfin at users.sourceforge.net
Mon Jan 6 08:05:02 CET 2003


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

Modified Files:
	actor.cpp actor.h akos.cpp script_v8.cpp 
Log Message:
some chore/limb related code

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- actor.cpp	6 Jan 2003 13:41:28 -0000	1.53
+++ actor.cpp	6 Jan 2003 16:03:58 -0000	1.54
@@ -1067,6 +1067,43 @@
 	}
 }
 
+void Actor::animateLimb(int limb, int f)
+{
+	// This methods is very similiar to animateCostume(). 
+	// However, instead of animating *all* the limbs, it only animates
+	// the specified limb to be at the frame specified by "f". 
+
+	if (!f)
+		return;
+
+	animProgress++;
+	if (animProgress >= animSpeed) {
+		animProgress = 0;
+
+		if (costume == 0)
+			return;
+
+		byte *aksq, *akfo;
+		uint size;
+		byte *akos = _vm->getResourceAddress(rtCostume, costume);
+		assert(akos);
+
+		aksq = _vm->findResourceData(MKID('AKSQ'), akos);
+		akfo = _vm->findResourceData(MKID('AKFO'), akos);
+	
+		size = _vm->getResourceDataSize(akfo) >> 1;
+	
+		while (f--) {
+			if (cost.active[limb] != 0)
+				_vm->akos_increaseAnim(this, limb, aksq, (uint16 *)akfo, size);
+		}
+
+//		needRedraw = true;
+//		needBgReset = true;
+	}
+}
+
+
 void Scumm::setActorRedrawFlags(bool fg, bool bg)
 {
 	int i, j;

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- actor.h	1 Jan 2003 18:22:40 -0000	1.10
+++ actor.h	6 Jan 2003 16:03:59 -0000	1.11
@@ -139,6 +139,9 @@
 	void drawActorCostume();
 	void animateCostume();
 	void setActorCostume(int c);
+	
+	void animateLimb(int limb, int f);
+	
 	byte *getActorName();
 	void startWalkActor(int x, int y, int dir);
 	void stopActorMoving();

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- akos.cpp	6 Jan 2003 13:41:29 -0000	1.35
+++ akos.cpp	6 Jan 2003 16:04:00 -0000	1.36
@@ -1339,7 +1339,7 @@
 	size = getResourceDataSize(akfo) >> 1;
 
 	result = false;
-	for (i = 0; i != 0x10; i++) {
+	for (i = 0; i < 16; i++) {
 		if (a->cost.active[i] != 0)
 			result |= akos_increaseAnim(a, i, aksq, (uint16 *)akfo, size);
 	}

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.94
retrieving revision 2.95
diff -u -d -r2.94 -r2.95
--- script_v8.cpp	6 Jan 2003 13:41:29 -0000	2.94
+++ script_v8.cpp	6 Jan 2003 16:04:01 -0000	2.95
@@ -1362,28 +1362,18 @@
 //		warning("o8_kernelSetFunctions: setBannerColors(%d, %d, %d, %d)", args[1], args[2], args[3], args[4]);
 		break;
 	case 23:	// setActorChoreLimbFrame
-		{
 		// FIXME: This is critical, and is the cause of the Cannon "too many scripts" crash
 		// This opcode is used a lot in script 28.
+		// The problem here is that args[4] is always 0, as it is computed from
+		// lipSyncWidth and lipSyncHeight, which we currently don't support. As a result,
+		// actors will currently not move their mouth at all!
 		warning("o8_kernelSetFunctions: setActorChoreLimbFrame(%d, %d, %d, %d)", args[1], args[2], args[3], args[4]);
 		a = derefActorSafe(args[1], "o8_kernelSetFunctions:setActorChoreLimbFrame");
 		assert(a);
-/*
-		// The naming of this opcode would suggest this labeling of variables:
-		int chore = args[2];	// mostly the return value of actorTalkAnimation() 
-		int limb = args[3];		// mostly 0 and 1, but also 2, 3
-		int frame = args[4];	// some number usually derived from lipSyncWidth and lipSyncHeight
-		
-		// However, I am not fully sure that is correct (names can deceive, or can simply be wrong).
-		// And even if it is, the question is how to use it...
+
+		a->startAnimActor(args[2]);
+		a->animateLimb(args[3], args[4]);
 		
-		// Note that akos_decodeData takes as parameter a "chore" = frame and bitmask
-		// specifiying a set of limbs. That would lead to code like this:
-		a->frame = chore;
-		akos_decodeData(a, frame, 0x8000 >> limb);
-		// But that seems to be quite bogus :-) Anyway, this is just random guessing, and
-		// it would be much better if somebody would disassmble the code in question.
-*/		}
 		break;
 	case 24:	// clearTextQueue
 		warning("o8_kernelSetFunctions: clearTextQueue()");
@@ -1478,16 +1468,14 @@
 		break;
 	case 0xDA:		// lipSyncWidth
 	case 0xDB:		// lipSyncHeight
-		// TODO - these methods are probably for lip syncing?
-		push(0);
+		// TODO - get lip sync data for the currently active voice
+		push(255);
 		break;
 	case 0xDC:		// actorTalkAnimation
-		// TODO - this method is used mostly to compute a parameter for setActorChoreLimbFrame 
-		// (to be precise, the second parameter, i.e. args[1])
 		{
 		Actor *a = derefActorSafe(args[1], "actorTalkAnimation");
 		assert(a);
-		push(0);
+		push(a->talkFrame1);
 		}
 		break;
 	case 0xDD:		// getMasterSFXVol
@@ -1512,8 +1500,9 @@
 			push(0);
 		}
 		break;
-	case 0XE2:		// musicLipSyncWidth
+	case 0xE2:		// musicLipSyncWidth
 	case 0xE3:		// musicLipSyncHeight
+		// TODO - get lip sync data for the currently active music
 		// FIXME: These are needed for the song intro to Part III - the scene will freeze
 		// without them.
 		warning("o8_kernelGetFunctions: default case 0x%x (len = %d)", args[0], len);
@@ -1531,11 +1520,7 @@
 	Actor *a = derefActorSafe(actnum, "o8_getActorChore");
 	assert(a);
 
-	// FIXME: hack to avoid the "Too many scripts running" in the canon scene
-	push(11);
-	// Maybe this would be the correct code here? What scumm calls a "chore" corresponds
-	// to our actor "frame", I think.
-//	push(a->frame);
+	push(a->frame);
 }
 
 void Scumm_v8::o8_getObjectImageX()





More information about the Scummvm-git-logs mailing list