diff options
author | Johannes Schickel | 2005-12-20 10:58:07 +0000 |
---|---|---|
committer | Johannes Schickel | 2005-12-20 10:58:07 +0000 |
commit | f241049961e4758894a0d1abefce6a225956f7d8 (patch) | |
tree | 6b1b9ff10043fc125543e5aa03acedf8c21fba65 /kyra/screen.cpp | |
parent | 53f13b76e41298536145b9e511c2938cc1bc1eb0 (diff) | |
download | scummvm-rg350-f241049961e4758894a0d1abefce6a225956f7d8.tar.gz scummvm-rg350-f241049961e4758894a0d1abefce6a225956f7d8.tar.bz2 scummvm-rg350-f241049961e4758894a0d1abefce6a225956f7d8.zip |
Fixes gfx bug in the temple and the cave, also corrected
the encodeShape and drawShape function for CD version.
svn-id: r19814
Diffstat (limited to 'kyra/screen.cpp')
-rw-r--r-- | kyra/screen.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kyra/screen.cpp b/kyra/screen.cpp index 6a32bc8c29..3c42de0461 100644 --- a/kyra/screen.cpp +++ b/kyra/screen.cpp @@ -673,6 +673,13 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int } memset(_decodeShapeBuffer, 0, _decodeShapeBufferSize); uint8 *decodedShapeFrame = _decodeShapeBuffer; + + // only used if shapeFlag & 1 is NOT zero + const uint8 *colorTable = shapeData + 10; + if (_vm->features() & GF_TALKIE) { + colorTable += 2; + } + for (int j = 0; j < shapeHeight; ++j) { uint8 *dsbNextLine = decodedShapeFrame + shapeWidth; int count = shapeWidth; @@ -681,8 +688,9 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int if (code != 0) { // this is guessed if (shapeFlags & 1) { - const uint8 *colorTable = shapeData + 10; - *decodedShapeFrame++ = colorTable[code]; + if (code < 16) { + *decodedShapeFrame++ = colorTable[code]; + } } else { *decodedShapeFrame++ = code; } @@ -1427,6 +1435,9 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) { if (flags & 1) { dst = newShape + 10; + if (_vm->features() & GF_TALKIE) { + dst += 2; + } src = &table[0x100]; memcpy(dst, src, sizeof(uint8)*16); } |