From 00f5d3fcdbd7b45138d342d528460a23bee57bb6 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 24 Dec 2019 18:18:04 +0100 Subject: DIRECTOR: Process non-BW bitmaps for D3 --- engines/director/cast.cpp | 19 +++++++++++++------ engines/director/cast.h | 4 ++-- engines/director/score.cpp | 6 +++--- 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 83d5a9d002..2a59443e27 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -34,24 +34,30 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 if (version < 4) { _pitch = 0; _flags = stream.readByte(); - _someFlaggyThing = stream.readUint16(); + _bytes = stream.readUint16(); _initialRect = Score::readRect(stream); _boundingRect = Score::readRect(stream); _regY = stream.readUint16(); _regX = stream.readUint16(); - _unk1 = _unk2 = 0; - if (_someFlaggyThing & 0x8000) { - _unk1 = stream.readUint16(); + if (_bytes & 0x8000) { + _bitsPerPixel = stream.readUint16(); _unk2 = stream.readUint16(); + } else { + _bitsPerPixel = 1; + _unk2 = 0; } + + _pitch = _initialRect.width(); + if (_pitch % 16) + _pitch += 16 - (_initialRect.width() % 16); } else if (version == 4) { _pitch = stream.readUint16(); _pitch &= 0x0fff; _flags = 0; - _someFlaggyThing = 0; - _unk1 = _unk2 = 0; + _bytes = 0; + _unk2 = 0; _initialRect = Score::readRect(stream); _boundingRect = Score::readRect(stream); @@ -71,6 +77,7 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 warning("BitmapCast: %d bytes left", tail); } else if (version == 5) { + _bytes = 0; _pitch = 0; uint16 count = stream.readUint16(); for (uint16 cc = 0; cc < count; cc++) diff --git a/engines/director/cast.h b/engines/director/cast.h index 9637b17114..9c026fc957 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -60,8 +60,8 @@ public: uint16 _regX; uint16 _regY; uint8 _flags; - uint16 _someFlaggyThing; - uint16 _unk1, _unk2; + uint16 _bytes; + uint16 _unk2; uint16 _bitsPerPixel; diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 8cb5513fdb..5e52251deb 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -303,11 +303,11 @@ void Score::loadSpriteImages(bool isSharedCast) { } int w = bitmapCast->_initialRect.width(), h = bitmapCast->_initialRect.height(); - debugC(4, kDebugImages, "Score::loadSpriteImages(): id: %d, w: %d, h: %d, flags: %x, some: %x, unk1: %d, unk2: %d", - imgId, w, h, bitmapCast->_flags, bitmapCast->_someFlaggyThing, bitmapCast->_unk1, bitmapCast->_unk2); + debugC(4, kDebugImages, "Score::loadSpriteImages(): id: %d, w: %d, h: %d, flags: %x, bytes: %x, bpp: %d unk2: %x", + imgId, w, h, bitmapCast->_flags, bitmapCast->_bytes, bitmapCast->_bitsPerPixel, bitmapCast->_unk2); if (pic != NULL && bitmapCast != NULL && w > 0 && h > 0) { - if (_vm->getVersion() < 4) { + if (_vm->getVersion() < 4 && 0) { img = new BITDDecoder(w, h); } else if (_vm->getVersion() < 6) { img = new BITDDecoderV4(w, h, bitmapCast->_bitsPerPixel, bitmapCast->_pitch); -- cgit v1.2.3