[Scummvm-cvs-logs] SF.net SVN: scummvm:[45396] scummvm/trunk/engines/scumm

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Mon Oct 26 11:15:06 CET 2009


Revision: 45396
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45396&view=rev
Author:   Kirben
Date:     2009-10-26 10:15:05 +0000 (Mon, 26 Oct 2009)

Log Message:
-----------
Add patch from Tobias, for object masking support in PCE version of Loom.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/scumm/gfx.h

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2009-10-26 09:47:55 UTC (rev 45395)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2009-10-26 10:15:05 UTC (rev 45396)
@@ -2612,7 +2612,7 @@
 		colors[(*rowIndex)++] = (cmd) & 0xF;
 }
 
-void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint16 *masks, int dataWidth, int numRows, bool isObject) {
+void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint16 *masks, int numRows, bool isObject) {
 	int loopCnt;
 	uint16 lastTileData;
 	
@@ -2699,7 +2699,7 @@
 	 * read mask indices
 	 */
 	
-	if (dataWidth == 0 || numRows < 18) {
+	if (_PCE.maskIDSize == 0 || numRows > 18) {
 		return;
 	}
 	
@@ -2711,7 +2711,7 @@
 			uint16 value;
 			if (cmd & 0x60) {
 				value = (cmd & 0x40) ? 0 : 0xFF;
-			} else if (dataWidth == 1) {
+			} else if (_PCE.maskIDSize == 1) {
 				value = *ptr++;
 			} else {
 				value = READ_LE_UINT16(ptr);
@@ -2722,7 +2722,7 @@
 			}
 		} else {
 			for (int i = 0; i < cnt; ++i) {
-				if (dataWidth == 1) {
+				if (_PCE.maskIDSize == 1) {
 					masks[rowIndex++] = *ptr++;
 				} else {
 					masks[rowIndex++] = READ_LE_UINT16(ptr);
@@ -2743,7 +2743,7 @@
 	*smap_ptr++; // roomID
 	int numStrips = *smap_ptr++;
 	int numRows = *smap_ptr++;
-	int dataWidth = *smap_ptr++;
+	_PCE.maskIDSize = *smap_ptr++;
 	*smap_ptr++; // unknown
 	
 	memset(_PCE.nametable, 0, sizeof(_PCE.nametable));
@@ -2755,7 +2755,6 @@
 			&_PCE.nametable[i * numRows], 
 			&_PCE.colortable[i * numRows],
 			&_PCE.masktable[i * numRows],
-			dataWidth,
 			numRows,
 			false);
 	}
@@ -2776,7 +2775,6 @@
 			&_PCE.nametableObj[i * numRows], 
 			&_PCE.colortableObj[i * numRows], 
 			&_PCE.masktableObj[i * numRows], 
-			0, // is this true?
 			numRows,
 			true);
 	}

Modified: scummvm/trunk/engines/scumm/gfx.h
===================================================================
--- scummvm/trunk/engines/scumm/gfx.h	2009-10-26 09:47:55 UTC (rev 45395)
+++ scummvm/trunk/engines/scumm/gfx.h	2009-10-26 10:15:05 UTC (rev 45396)
@@ -307,7 +307,7 @@
 		uint16 nametable[4096], nametableObj[512];
 		byte colortable[4096], colortableObj[512];
 		uint16 masktable[4096], masktableObj[512];
-		int  objX;
+		int maskIDSize;
 		int numTiles;
 		int numMasks;
 		byte* tiles;
@@ -316,7 +316,7 @@
 
 protected:
 	void decodePCEngineGfx(const byte *room);
-	void decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint16 *masks, int dataWidth, int numRows, bool isObject);
+	void decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint16 *masks, int numRows, bool isObject);
 	void decodePCEngineTileData(const byte *ptr);
 	void decodePCEngineMaskData(const byte *ptr);
 	void decodePCEngineObject(const byte *ptr, int xpos, int ypos, int width, int height);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list