diff options
author | Scott Percival | 2018-11-24 23:55:26 +0800 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-17 22:31:54 +0100 |
commit | 3096a91c1215714a79c05b42f28118148a0ec8eb (patch) | |
tree | 9d79e4bf9168373a456b7f511c8198bb81a450e5 /engines | |
parent | 2aa2b196c21427adab16d3d8ca9367ee97bc812e (diff) | |
download | scummvm-rg350-3096a91c1215714a79c05b42f28118148a0ec8eb.tar.gz scummvm-rg350-3096a91c1215714a79c05b42f28118148a0ec8eb.tar.bz2 scummvm-rg350-3096a91c1215714a79c05b42f28118148a0ec8eb.zip |
DIRECTOR: extract image pitch from BitmapCast
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/cast.cpp | 6 | ||||
-rw-r--r-- | engines/director/cast.h | 1 | ||||
-rw-r--r-- | engines/director/images.cpp | 7 | ||||
-rw-r--r-- | engines/director/images.h | 2 | ||||
-rw-r--r-- | engines/director/score.cpp | 2 |
5 files changed, 8 insertions, 10 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 564460b640..fe0f72d856 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -29,6 +29,7 @@ namespace Director { BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) { if (version < 4) { + pitch = 0; flags = stream.readByte(); someFlaggyThing = stream.readUint16(); initialRect = Score::readRect(stream); @@ -42,8 +43,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 unk2 = stream.readUint16(); } } else if (version == 4) { - stream.readByte(); - stream.readByte(); + pitch = stream.readUint16(); + pitch &= 0x0fff; flags = 0; someFlaggyThing = 0; @@ -67,6 +68,7 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 warning("BitmapCast: %d bytes left", tail); } else if (version == 5) { + pitch = 0; uint16 count = stream.readUint16(); for (uint16 cc = 0; cc < count; cc++) stream.readUint32(); diff --git a/engines/director/cast.h b/engines/director/cast.h index bc020722a4..8acbc39acd 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -65,6 +65,7 @@ class BitmapCast : public Cast { public: BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version = 2); + uint16 pitch; uint16 regX; uint16 regY; uint8 flags; diff --git a/engines/director/images.cpp b/engines/director/images.cpp index 007dc8a496..8a8d56c432 100644 --- a/engines/director/images.cpp +++ b/engines/director/images.cpp @@ -205,14 +205,9 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) { * BITD V4+ ****************************/ -BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel) { +BITDDecoderV4::BITDDecoderV4(int w, int h, uint16 bitsPerPixel, uint16 pitch) { _surface = new Graphics::Surface(); - // We make the surface pitch a multiple of 16. - int pitch = w; - if (w % 16) - pitch += 16 - (w % 16); - Graphics::PixelFormat pf = Graphics::PixelFormat::createFormatCLUT8(); switch (bitsPerPixel) { case 2: diff --git a/engines/director/images.h b/engines/director/images.h index 8d25d348d2..7ffda68e52 100644 --- a/engines/director/images.h +++ b/engines/director/images.h @@ -83,7 +83,7 @@ private: class BITDDecoderV4 : public Image::ImageDecoder { public: - BITDDecoderV4(int w, int h, uint16 bitsPerPixel); + BITDDecoderV4(int w, int h, uint16 bitsPerPixel, uint16 pitch); virtual ~BITDDecoderV4(); // ImageDecoder API diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 9d16267ce2..19128ab414 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -266,7 +266,7 @@ void Score::loadSpriteImages(bool isSharedCast) { if (_vm->getVersion() < 4) { img = new BITDDecoder(w, h); } else if (_vm->getVersion() < 6) { - img = new BITDDecoderV4(w, h, bitmapCast->bitsPerPixel); + img = new BITDDecoderV4(w, h, bitmapCast->bitsPerPixel, bitmapCast->pitch); } else { img = new Image::BitmapDecoder(); } |