[Scummvm-git-logs] scummvm master -> 214042560531e069e7089f6058be5eb88397d15e

moralrecordings code at moral.net.au
Sat Jan 4 15:36:29 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2140425605 DIRECTOR: Fix palette for drawing operations


Commit: 214042560531e069e7089f6058be5eb88397d15e
    https://github.com/scummvm/scummvm/commit/214042560531e069e7089f6058be5eb88397d15e
Author: Scott Percival (code at moral.net.au)
Date: 2020-01-04T23:35:39+08:00

Commit Message:
DIRECTOR: Fix palette for drawing operations

Changed paths:
    engines/director/cast.cpp
    engines/director/frame.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 1d22da7..8ec151c 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<ShapeType>(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<InkType>(_fillType & 0x3f);
 		_lineThickness = stream.readByte();
@@ -288,8 +288,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
 		_shapeType = static_cast<ShapeType>(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<InkType>(_fillType & 0x3f);
 		_lineThickness = stream.readByte();
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 9a15554..24a0be8 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<InkType>(sprite._flags & 0x3f);




More information about the Scummvm-git-logs mailing list