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/ui | |
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/ui')
-rw-r--r-- | engines/bladerunner/ui/esper.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp index af6150f983..929601677f 100644 --- a/engines/bladerunner/ui/esper.cpp +++ b/engines/bladerunner/ui/esper.cpp @@ -1433,6 +1433,13 @@ void ESPER::selectPhoto(int photoId) { s->read(photoCompressed, photoCompressedSize); decompress_lcw(photoCompressed, photoCompressedSize, (uint8 *)_surfacePhoto.getPixels(), photoSize); +#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 *rawData = (uint8 *)_surfacePhoto.getPixels(); + for (size_t i = 0; i < photoSize - 1; i += 2) { + SWAP(rawData[i], rawData[i + 1]); + } +#endif // apply palette for (uint j = 0; j < width * height; ++j) { |