[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.218,1.219 actor.h,1.49,1.50 script_v6.cpp,1.269,1.270

Travis Howell kirben at users.sourceforge.net
Thu Jan 15 17:53:04 CET 2004


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

Modified Files:
	actor.cpp actor.h script_v6.cpp 
Log Message:

Add correct actor palette color changing for HE games.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -d -r1.218 -r1.219
--- actor.cpp	15 Jan 2004 06:36:58 -0000	1.218
+++ actor.cpp	16 Jan 2004 01:52:49 -0000	1.219
@@ -1586,6 +1586,40 @@
 	return ptr;
 }
 
+void Actor::remapActorPaletteColor(int color, int new_color) {
+	const byte *akos, *akpl;
+	int akpl_size, i;
+	byte akpl_color;
+
+	akos = _vm->getResourceAddress(rtCostume, costume);
+	if (!akos) {
+		warning("Can't remap actor %d, costume %d not found", number, costume);
+		return;
+	}
+
+	akpl = findResource(MKID('AKPL'), akos);
+	if (!akpl) {
+		warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", number, costume);
+		return;
+	}
+
+	//get num palette entries
+	akpl_size = RES_SIZE(akpl) - 8;
+
+	//skip resource header
+	akpl = RES_DATA(akpl);
+
+	for (i = 0; i < akpl_size; i++) {
+		akpl_color = *akpl++;
+		if (akpl_color == color) {
+			palette[i] = new_color;
+			return;
+		}
+	}
+
+	warning("Color %d not found in actor %d", color, number);
+}
+
 void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold) {
 	const byte *akos, *rgbs, *akpl;
 	int akpl_size, i;

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- actor.h	12 Jan 2004 14:09:39 -0000	1.49
+++ actor.h	16 Jan 2004 01:52:49 -0000	1.50
@@ -167,6 +167,7 @@
 	void startAnimActor(int frame);
 
 	void remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold);
+	void remapActorPaletteColor(int slot, int color);
 
 	void animateActor(int anim);
 

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -d -r1.269 -r1.270
--- script_v6.cpp	15 Jan 2004 20:37:26 -0000	1.269
+++ script_v6.cpp	16 Jan 2004 01:52:49 -0000	1.270
@@ -1705,7 +1705,10 @@
 		j = pop();
 		i = pop();
 		checkRange(255, 0, i, "Illegal palette slot %d");
-		a->setPalette(i, j);
+		if (_features & GF_HUMONGOUS)
+			a->remapActorPaletteColor(i, j);
+		else
+			a->setPalette(i, j);
 		break;
 	case 87:		// SO_TALK_COLOR
 		a->talkColor = pop();





More information about the Scummvm-git-logs mailing list