aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2014-12-27 23:35:35 +0100
committerWillem Jan Palenstijn2014-12-27 23:35:35 +0100
commit5791f600e9b9808714b40a63acd09b5657c855f5 (patch)
tree7058734f7f3e828a955ac08aa030737bf1d85186
parent02eada1d0ddd5f5c179ca39840bb7f73286df6e1 (diff)
downloadscummvm-rg350-5791f600e9b9808714b40a63acd09b5657c855f5.tar.gz
scummvm-rg350-5791f600e9b9808714b40a63acd09b5657c855f5.tar.bz2
scummvm-rg350-5791f600e9b9808714b40a63acd09b5657c855f5.zip
ZVISION: Fix TGZ images on BE systems
-rw-r--r--engines/zvision/graphics/render_manager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index 4f26123fc8..a178c97639 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -209,13 +209,17 @@ void RenderManager::readImageToSurface(const Common::String &fileName, Graphics:
isTGZ = true;
// TGZ files have a header and then Bitmap data that is compressed with LZSS
- uint32 decompressedSize = file.readSint32LE();
+ uint32 decompressedSize = file.readSint32LE() / 2;
imageWidth = file.readSint32LE();
imageHeight = file.readSint32LE();
LzssReadStream lzssStream(&file);
buffer = (uint16 *)(new uint16[decompressedSize]);
- lzssStream.read(buffer, decompressedSize);
+ lzssStream.read(buffer, 2 * decompressedSize);
+#ifndef SCUMMVM_LITTLE_ENDIAN
+ for (uint32 i = 0; i < decompressedSize; ++i)
+ buffer[i] = FROM_LE_16(buffer[i]);
+#endif
} else {
isTGZ = false;