From 214042560531e069e7089f6058be5eb88397d15e Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Sat, 4 Jan 2020 23:35:39 +0800 Subject: DIRECTOR: Fix palette for drawing operations --- engines/director/cast.cpp | 8 ++++---- engines/director/frame.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 1d22da7228..8ec151cb1b 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -276,8 +276,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { _shapeType = static_cast(stream.readByte()); _initialRect = Score::readRect(stream); _pattern = stream.readUint16BE(); - _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256 - _bgCol = (127 - stream.readByte()) & 0xff; + _fgCol = 0xff - (uint8)stream.readByte(); + _bgCol = 0xff - (uint8)stream.readByte(); _fillType = stream.readByte(); _ink = static_cast(_fillType & 0x3f); _lineThickness = stream.readByte(); @@ -288,8 +288,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { _shapeType = static_cast(stream.readByte()); _initialRect = Score::readRect(stream); _pattern = stream.readUint16BE(); - _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256 - _bgCol = (127 - stream.readByte()) & 0xff; + _fgCol = 0xff - (uint8)stream.readByte(); + _bgCol = 0xff - (uint8)stream.readByte(); _fillType = stream.readByte(); _ink = static_cast(_fillType & 0x3f); _lineThickness = stream.readByte(); diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 9a15554142..24a0be8f00 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -197,8 +197,8 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) { sprite._scriptId = stream->readByte(); sprite._spriteType = stream->readByte(); sprite._enabled = sprite._spriteType != 0; - sprite._foreColor = (127 - stream->readByte()) & 0xff; // -128 -> 0, 127 -> 256 - sprite._backColor = (127 - stream->readByte()) & 0xff; + sprite._foreColor = 0xff - (uint8)stream->readByte(); + sprite._backColor = 0xff - (uint8)stream->readByte(); sprite._flags = stream->readUint16(); sprite._ink = static_cast(sprite._flags & 0x3f); -- cgit v1.2.3