diff options
author | Matthew Hoops | 2011-02-20 00:43:18 -0500 |
---|---|---|
committer | Matthew Hoops | 2011-02-20 00:43:18 -0500 |
commit | 098581b3b5ec22f2e50075414f74f378ad24c2ae (patch) | |
tree | 57a97ce4bc7e570fba138f301402caf442ff192d /graphics | |
parent | f8df58f9578fbacaea0910435e42c096c20226c7 (diff) | |
download | scummvm-rg350-098581b3b5ec22f2e50075414f74f378ad24c2ae.tar.gz scummvm-rg350-098581b3b5ec22f2e50075414f74f378ad24c2ae.tar.bz2 scummvm-rg350-098581b3b5ec22f2e50075414f74f378ad24c2ae.zip |
GRAPHICS: Use the DirectBits size instead of the overall PICT dimensions
Fixes some Myst ME images
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pict.cpp | 9 | ||||
-rw-r--r-- | graphics/pict.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/graphics/pict.cpp b/graphics/pict.cpp index 95f659c19b..9079223237 100644 --- a/graphics/pict.cpp +++ b/graphics/pict.cpp @@ -95,10 +95,10 @@ Surface *PictDecoder::decodeImage(Common::SeekableReadStream *stream, byte *pale } else if (opcode == 0x001E) { // DefHilite // Ignore, Contains no Data } else if (opcode == 0x0098) { // PackBitsRect - decodeDirectBitsRect(stream, _imageRect.width(), _imageRect.height(), true); + decodeDirectBitsRect(stream, true); _isPaletted = true; } else if (opcode == 0x009A) { // DirectBitsRect - decodeDirectBitsRect(stream, _imageRect.width(), _imageRect.height(), false); + decodeDirectBitsRect(stream, false); } else if (opcode == 0x00A1) { // LongComment stream->readUint16BE(); uint16 dataSize = stream->readUint16BE(); @@ -162,7 +162,7 @@ struct DirectBitsRectData { uint16 mode; }; -void PictDecoder::decodeDirectBitsRect(Common::SeekableReadStream *stream, uint16 width, uint16 height, bool hasPalette) { +void PictDecoder::decodeDirectBitsRect(Common::SeekableReadStream *stream, bool hasPalette) { static const PixelFormat directBitsFormat16 = PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); // Clear the palette @@ -196,6 +196,9 @@ void PictDecoder::decodeDirectBitsRect(Common::SeekableReadStream *stream, uint1 directBitsData.dstRect.right = stream->readUint16BE(); directBitsData.mode = stream->readUint16BE(); + uint16 width = directBitsData.srcRect.width(); + uint16 height = directBitsData.srcRect.height(); + byte bytesPerPixel = 0; if (directBitsData.pixMap.pixelSize <= 8) diff --git a/graphics/pict.h b/graphics/pict.h index a9ea170292..e4bde8a466 100644 --- a/graphics/pict.h +++ b/graphics/pict.h @@ -74,7 +74,7 @@ private: bool _isPaletted; Graphics::Surface *_outputSurface; - void decodeDirectBitsRect(Common::SeekableReadStream *stream, uint16 width, uint16 height, bool hasPalette); + void decodeDirectBitsRect(Common::SeekableReadStream *stream, bool hasPalette); void decodeDirectBitsLine(byte *out, uint32 length, Common::SeekableReadStream *data, byte bitsPerPixel, byte bytesPerPixel); void decodeCompressedQuickTime(Common::SeekableReadStream *stream); void outputPixelBuffer(byte *&out, byte value, byte bitsPerPixel); |