mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
SHERLOCK: Implement Tattoo version of image RLE compression
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user