aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-16 22:27:36 -0400
committerPaul Gilbert2015-05-16 22:27:36 -0400
commit7aa804b5ccd3489c852bbde01362bd2ce91d6cf8 (patch)
tree52f73b150df7299d444d437356b07c409d836c6d /engines/sherlock
parent7963c64c06e5765c5ca96917a8b4a2c7258c6f37 (diff)
downloadscummvm-rg350-7aa804b5ccd3489c852bbde01362bd2ce91d6cf8.tar.gz
scummvm-rg350-7aa804b5ccd3489c852bbde01362bd2ce91d6cf8.tar.bz2
scummvm-rg350-7aa804b5ccd3489c852bbde01362bd2ce91d6cf8.zip
SHERLOCK: Implement Tattoo version of image RLE compression
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/resources.cpp22
-rw-r--r--engines/sherlock/scene.cpp2
2 files changed, 23 insertions, 1 deletions
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index 1c154a3a5f..24fef3f235 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -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();
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index bf8d837f9e..034896486e 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -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);