diff options
author | Travis Howell | 2009-10-26 10:15:05 +0000 |
---|---|---|
committer | Travis Howell | 2009-10-26 10:15:05 +0000 |
commit | 88c7ca6f8fb20b04a31c85fe921404f1981e1ca4 (patch) | |
tree | 68343080560ce1cab9d07e81c031e873eac9635a | |
parent | e35b6a6e8051ce8efa35df48a36312d4f498accd (diff) | |
download | scummvm-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
-rw-r--r-- | engines/scumm/gfx.cpp | 12 | ||||
-rw-r--r-- | engines/scumm/gfx.h | 4 |
2 files changed, 7 insertions, 9 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); } diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index 3548a93317..bb9acbeef8 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -307,7 +307,7 @@ protected: 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: 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); |