[Scummvm-git-logs] scummvm master -> f2bbbd17f722b3f45aa2d6217c9f48ce731584e5
elasota
noreply at scummvm.org
Sun Jun 26 00:56:38 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f2bbbd17f7 MTROPOLIS: Fix incorrect uncompressed 32-bit mToon decoding
Commit: f2bbbd17f722b3f45aa2d6217c9f48ce731584e5
https://github.com/scummvm/scummvm/commit/f2bbbd17f722b3f45aa2d6217c9f48ce731584e5
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-25T20:56:08-04:00
Commit Message:
MTROPOLIS: Fix incorrect uncompressed 32-bit mToon decoding
Changed paths:
engines/mtropolis/assets.cpp
diff --git a/engines/mtropolis/assets.cpp b/engines/mtropolis/assets.cpp
index 192ff0c97e1..a64f5cb7665 100644
--- a/engines/mtropolis/assets.cpp
+++ b/engines/mtropolis/assets.cpp
@@ -420,8 +420,13 @@ void CachedMToon::loadUncompressedFrame(const Common::Array<uint8> &data, size_t
static_cast<uint16 *>(outDataUntyped)[col] = (inData[col * 2 + 1] << 8) | (inData[col * 2]);
}
} else if (bpp == 32) {
- for (size_t col = 0; col < w; col++)
- static_cast<uint32 *>(outDataUntyped)[col] = (0xff000000 | (inData[col * 4]) | (inData[col * 4 + 1] << 8) | (inData[col * 4 + 2] << 16));
+ if (_metadata->imageFormat == MToonMetadata::kImageFormatMac) {
+ for (size_t col = 0; col < w; col++)
+ static_cast<uint32 *>(outDataUntyped)[col] = (0xff000000 | (inData[col * 4 + 1]) | (inData[col * 4 + 2] << 8) | (inData[col * 4 + 3] << 16));
+ } else if (_metadata->imageFormat == MToonMetadata::kImageFormatWindows) {
+ for (size_t col = 0; col < w; col++)
+ static_cast<uint32 *>(outDataUntyped)[col] = (0xff000000 | (inData[col * 4 + 2]) | (inData[col * 4 + 1] << 8) | (inData[col * 4 + 0] << 16));
+ }
}
}
@@ -430,7 +435,6 @@ void CachedMToon::loadUncompressedFrame(const Common::Array<uint8> &data, size_t
void CachedMToon::decompressQuickTimeFrame(const Common::Array<uint8> &data, size_t frameIndex) {
const MToonMetadata::FrameDef &frameDef = _metadata->frames[frameIndex];
- uint16 stride = frameDef.decompressedBytesPerRow;
uint16 bpp = _metadata->bitsPerPixel;
size_t w = frameDef.rect.width();
More information about the Scummvm-git-logs
mailing list