SHERLOCK: Implement Tattoo version of image RLE compression

This commit is contained in:
Paul Gilbert
2015-05-16 22:27:36 -04:00
parent 7963c64c06
commit 7aa804b5cc
2 changed files with 23 additions and 1 deletions
+22
View File
@@ -383,6 +383,28 @@ void ImageFile::decompressFrame(ImageFrame &frame, const byte *src) {
*pDest++ = *src & 0xF;
*pDest++ = (*src >> 4);
}
} else if (frame._rleEncoded && _vm->getGameID() == GType_RoseTattoo) {
// Rose Tattoo run length encoding doesn't use the RLE marker byte
byte *dst = (byte *)frame._frame.getPixels();
for (int yp = 0; yp < frame._height; ++yp) {
int xSize = frame._width;
while (xSize > 0) {
// Skip a given number of pixels
byte skip = *src++;
dst += skip;
xSize -= skip;
if (!xSize)
break;
// Get a run length, and copy the following number of pixels
int rleCount = *src++;
xSize -= rleCount;
while (rleCount-- > 0)
*dst++ = *src++;
}
assert(xSize == 0);
}
} else if (frame._rleEncoded) {
// RLE encoded
byte *dst = (byte *)frame._frame.getPixels();
+1 -1
View File
@@ -370,7 +370,7 @@ bool Scene::loadScene(const Common::String &filename) {
// Read in the image data
Common::SeekableReadStream *imageStream = _lzwMode ?
Resources::decompressLZ(*rrmStream, bgInfo[idx]._filesize) :
res.decompress(*rrmStream, bgInfo[idx]._filesize) :
rrmStream->readStream(bgInfo[idx]._filesize);
_images[idx + 1]._images = new ImageFile(*imageStream);