[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.379.2.6,1.379.2.7 akos.cpp,1.236.2.6,1.236.2.7 akos.h,1.42.2.1,1.42.2.2 base-costume.h,1.43.2.1,1.43.2.2 costume.cpp,1.192.2.1,1.192.2.2 costume.h,1.39.2.1,1.39.2.2

kirben kirben at users.sourceforge.net
Thu Jan 12 21:48:00 CET 2006


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31022/scumm

Modified Files:
      Tag: branch-0-8-0
	actor.cpp akos.cpp akos.h base-costume.h costume.cpp costume.h 
Log Message:

Backport xmap support update for HE games.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.379.2.6
retrieving revision 1.379.2.7
diff -u -d -r1.379.2.6 -r1.379.2.7
--- actor.cpp	18 Nov 2005 23:49:06 -0000	1.379.2.6
+++ actor.cpp	13 Jan 2006 05:47:10 -0000	1.379.2.7
@@ -1105,26 +1105,13 @@
 	}
 
 	bcr->_shadow_mode = _shadowMode;
-	if (_vm->_features & GF_SMALL_HEADER) {
-		bcr->_shadow_table = NULL;
-#ifndef DISABLE_HE
-	} else if (_vm->_heversion >= 95 && _heXmapNum) {
-		const uint8 *dataPtr = _vm->getResourceAddress(rtImage, _heXmapNum);
-		assert(dataPtr);
-		const uint8 *xmapPtr = _vm->findResourceData(MKID('XMAP'), dataPtr);
-		assert(xmapPtr);
-		int32 size = _vm->getResourceDataSize(xmapPtr);
-		assert(size == 65536);
-		memcpy(_vm->_shadowPalette, xmapPtr, size);
+	if (_vm->_version >= 5 && _vm->_heversion == 0) {
 		bcr->_shadow_table = _vm->_shadowPalette;
 	} else if (_vm->_heversion == 70) {
 		bcr->_shadow_table = _vm->_HEV7ActorPalette;
-#endif
-	} else {
-		bcr->_shadow_table = _vm->_shadowPalette;
 	}
 
-	bcr->setCostume(_costume);
+	bcr->setCostume(_costume, _heXmapNum);
 	bcr->setPalette(_palette);
 	bcr->setFacing(this);
 

Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.236.2.6
retrieving revision 1.236.2.7
diff -u -d -r1.236.2.6 -r1.236.2.7
--- akos.cpp	28 Nov 2005 00:22:48 -0000	1.236.2.6
+++ akos.cpp	13 Jan 2006 05:47:13 -0000	1.236.2.7
@@ -324,7 +324,7 @@
 	}
 }
 
-void AkosRenderer::setCostume(int costume) {
+void AkosRenderer::setCostume(int costume, int shadow) {
 	akos = _vm->getResourceAddress(rtCostume, costume);
 	assert(akos);
 
@@ -336,6 +336,14 @@
 	akpl = _vm->findResourceData(MKID('AKPL'), akos);
 	codec = READ_LE_UINT16(&akhd->codec);
 	akct = _vm->findResourceData(MKID('AKCT'), akos);
+
+	xmap = 0;
+	if (shadow) {
+		const uint8 *xmapPtr = _vm->getResourceAddress(rtImage, shadow);
+		assert(xmapPtr);
+		xmap = _vm->findResourceData(MKID('XMAP'), xmapPtr);
+		assert(xmap);
+	}
 }
 
 void AkosRenderer::setFacing(const Actor *a) {
@@ -469,7 +477,7 @@
 				} else {
 					uint32 type = cond & 0xC0000000;
 					cond &= 0x3FFFFFFF;
-					if (_vm->_heversion >= 95) {
+					if (_vm->_heversion >= 90) {
 						shadowMask = cond & 0xE000;
 						cond &= ~0xE000;
 					}
@@ -490,8 +498,8 @@
 			if (decflag == 0)
 				continue;
 
-			if (_vm->_heversion >= 95) {
-				_shadow_mode = ((shadowMask & 0x8000) && _shadow_table) ? 3 : 0;
+			if (_vm->_heversion >= 90) {
+				_shadow_mode = ((shadowMask & 0x8000) && xmap) ? 3 : 0;
 			}
 
 			switch (codec) {
@@ -565,7 +573,10 @@
 						} else if (_shadow_mode == 2) {
 							error("codec1_spec2"); // TODO
 						} else if (_shadow_mode == 3) {
-							if (_vm->_heversion >= 95 || pcolor < 8) {
+							if (_vm->_heversion >= 90) {
+								pcolor = (pcolor << 8) + *dst;
+								pcolor = xmap[pcolor];
+							} else if (pcolor < 8) {
 								pcolor = (pcolor << 8) + *dst;
 								pcolor = _shadow_table[pcolor];
 							}
@@ -1323,7 +1334,7 @@
 
 	byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch;
 	if (_shadow_mode == 3) {
-		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, _shadow_table);
+		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, xmap);
 	} else {
 		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr);
 	}

Index: akos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.h,v
retrieving revision 1.42.2.1
retrieving revision 1.42.2.2
diff -u -d -r1.42.2.1 -r1.42.2.2
--- akos.h	18 Oct 2005 02:11:21 -0000	1.42.2.1
+++ akos.h	13 Jan 2006 05:47:14 -0000	1.42.2.2
@@ -67,6 +67,7 @@
 	const AkosOffset *akof;
 	const byte *akcd;
 	const byte *akct;
+	const uint8 *xmap;
 
 	struct {
 		byte unk5;
@@ -90,6 +91,7 @@
 		akof = 0;
 		akcd = 0;
 		akct = 0;
+		xmap = 0;
 		_actorHitMode = false;
 	}
 
@@ -99,7 +101,7 @@
 
 	void setPalette(byte *palette);
 	void setFacing(const Actor *a);
-	void setCostume(int costume);
+	void setCostume(int costume, int shadow);
 
 protected:
 	byte drawLimb(const Actor *a, int limb);

Index: base-costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/base-costume.h,v
retrieving revision 1.43.2.1
retrieving revision 1.43.2.2
diff -u -d -r1.43.2.1 -r1.43.2.2
--- base-costume.h	18 Oct 2005 02:11:21 -0000	1.43.2.1
+++ base-costume.h	13 Jan 2006 05:47:14 -0000	1.43.2.2
@@ -151,7 +151,7 @@
 
 	virtual void setPalette(byte *palette) = 0;
 	virtual void setFacing(const Actor *a) = 0;
-	virtual void setCostume(int costume) = 0;
+	virtual void setCostume(int costume, int shadow) = 0;
 
 
 	byte drawCostume(const VirtScreen &vs, int numStrips, const Actor *a, bool drawToBackBuf);

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.192.2.1
retrieving revision 1.192.2.2
diff -u -d -r1.192.2.1 -r1.192.2.2
--- costume.cpp	18 Oct 2005 02:11:21 -0000	1.192.2.1
+++ costume.cpp	13 Jan 2006 05:47:14 -0000	1.192.2.2
@@ -781,7 +781,7 @@
 	//_mirror = newDirToOldDir(a->getFacing()) != 0 || _loaded._mirror;
 }
 
-void NESCostumeRenderer::setCostume(int costume) {
+void NESCostumeRenderer::setCostume(int costume, int shadow) {
 	_loaded.loadCostume(costume);
 }
 
@@ -888,7 +888,7 @@
 	_mirror = newDirToOldDir(a->getFacing()) != 0 || _loaded._mirror;
 }
 
-void ClassicCostumeRenderer::setCostume(int costume) {
+void ClassicCostumeRenderer::setCostume(int costume, int shadow) {
 	_loaded.loadCostume(costume);
 }
 
@@ -1120,7 +1120,7 @@
 	return 0;
 }
 
-void C64CostumeRenderer::setCostume(int costume) {
+void C64CostumeRenderer::setCostume(int costume, int shadow) {
 	_loaded.loadCostume(costume);
 }
 

Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.h,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -u -d -r1.39.2.1 -r1.39.2.2
--- costume.h	18 Oct 2005 02:11:21 -0000	1.39.2.1
+++ costume.h	13 Jan 2006 05:47:14 -0000	1.39.2.2
@@ -92,7 +92,7 @@
 
 	void setPalette(byte *palette);
 	void setFacing(const Actor *a);
-	void setCostume(int costume);
+	void setCostume(int costume, int shadow);
 
 protected:
 	byte drawLimb(const Actor *a, int limb);
@@ -114,7 +114,7 @@
 
 	void setPalette(byte *palette);
 	void setFacing(const Actor *a);
-	void setCostume(int costume);
+	void setCostume(int costume, int shadow);
 
 protected:
 	byte drawLimb(const Actor *a, int limb);
@@ -129,7 +129,7 @@
 
 	void setPalette(byte *palette) {}
 	void setFacing(const Actor *a) {}
-	void setCostume(int costume);
+	void setCostume(int costume, int shadow);
 
 protected:
 	byte drawLimb(const Actor *a, int limb);





More information about the Scummvm-git-logs mailing list