diff options
author | Peter Kohaut | 2019-04-02 18:48:28 +0200 |
---|---|---|
committer | Peter Kohaut | 2019-04-02 18:55:53 +0200 |
commit | c47237e5b9d5b6d28ecc39757c13b54fb2f8aa23 (patch) | |
tree | 627dc361353a009910948fe4e25af0589e78e72d /engines/bladerunner/zbuffer.cpp | |
parent | c0aeb99d7862cb3f1e4681139edc11ea65023ce9 (diff) | |
download | scummvm-rg350-c47237e5b9d5b6d28ecc39757c13b54fb2f8aa23.tar.gz scummvm-rg350-c47237e5b9d5b6d28ecc39757c13b54fb2f8aa23.tar.bz2 scummvm-rg350-c47237e5b9d5b6d28ecc39757c13b54fb2f8aa23.zip |
BLADERUNNER: Fixed images & z-buffer on big-endian architectures
Diffstat (limited to 'engines/bladerunner/zbuffer.cpp')
-rw-r--r-- | engines/bladerunner/zbuffer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/bladerunner/zbuffer.cpp b/engines/bladerunner/zbuffer.cpp index 21fa6c5da1..ccc6a0075c 100644 --- a/engines/bladerunner/zbuffer.cpp +++ b/engines/bladerunner/zbuffer.cpp @@ -154,6 +154,13 @@ bool ZBuffer::decodeData(const uint8 *data, int size) { resetUpdates(); size_t zbufOutSize; decompress_lzo1x(data, size, (uint8 *)_zbuf1, &zbufOutSize); +#ifdef SCUMM_BIG_ENDIAN + // As the compression is working with 8-bit data, on big-endian architectures we have to switch order of bytes in uncompressed data + uint8 *rawZbuf = (uint8 *)_zbuf1; + for (size_t i = 0; i < zbufOutSize - 1; i += 2) { + SWAP(rawZbuf[i], rawZbuf[i + 1]); + } +#endif memcpy(_zbuf2, _zbuf1, 2 * _width * _height); } else { clean(); |