mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 18:06:26 +00:00
GRAPHICS: Use the DirectBits size instead of the overall PICT dimensions
Fixes some Myst ME images
This commit is contained in:
parent
f8df58f957
commit
098581b3b5
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user