aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-10-26 10:15:05 +0000
committerTravis Howell2009-10-26 10:15:05 +0000
commit88c7ca6f8fb20b04a31c85fe921404f1981e1ca4 (patch)
tree68343080560ce1cab9d07e81c031e873eac9635a /engines/scumm/gfx.cpp
parente35b6a6e8051ce8efa35df48a36312d4f498accd (diff)
downloadscummvm-rg350-88c7ca6f8fb20b04a31c85fe921404f1981e1ca4.tar.gz
scummvm-rg350-88c7ca6f8fb20b04a31c85fe921404f1981e1ca4.tar.bz2
scummvm-rg350-88c7ca6f8fb20b04a31c85fe921404f1981e1ca4.zip
Add patch from Tobias, for object masking support in PCE version of Loom.
svn-id: r45396
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r--engines/scumm/gfx.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 42443f8be6..8254efe477 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -2612,7 +2612,7 @@ void decodeTileColor(byte cmd, byte *colors, int *rowIndex, int numRows) {
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 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint
* read mask indices
*/
- if (dataWidth == 0 || numRows < 18) {
+ if (_PCE.maskIDSize == 0 || numRows > 18) {
return;
}
@@ -2711,7 +2711,7 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint
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 @@ void GdiPCEngine::decodeStrip(const byte *ptr, uint16 *tiles, byte *colors, uint
}
} 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 @@ void GdiPCEngine::decodePCEngineGfx(const byte *room) {
*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 @@ void GdiPCEngine::decodePCEngineGfx(const byte *room) {
&_PCE.nametable[i * numRows],
&_PCE.colortable[i * numRows],
&_PCE.masktable[i * numRows],
- dataWidth,
numRows,
false);
}
@@ -2776,7 +2775,6 @@ void GdiPCEngine::decodePCEngineObject(const byte *ptr, int xpos, int ypos, int
&_PCE.nametableObj[i * numRows],
&_PCE.colortableObj[i * numRows],
&_PCE.masktableObj[i * numRows],
- 0, // is this true?
numRows,
true);
}