[Scummvm-git-logs] scummvm master -> 4b3a5257f5f5e848bc46c479b0b98e78b0f5cc18
moralrecordings
code at moral.net.au
Sun Jan 5 03:53:32 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
86db38520a DIRECTOR: Fix solid fill shapes
2910e20a92 DIRECTOR: Re-add strange colour mapping for v3 and below
4b3a5257f5 DIRECTOR: Extend sprite line size to 3-bit
Commit: 86db38520a5fd5e02a6e48b07da22c0072f495c6
https://github.com/scummvm/scummvm/commit/86db38520a5fd5e02a6e48b07da22c0072f495c6
Author: Scott Percival (code at moral.net.au)
Date: 2020-01-05T11:35:40+08:00
Commit Message:
DIRECTOR: Fix solid fill shapes
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 24a0be8..672e856 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -208,7 +208,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;
- sprite._lineSize = (sprite._flags >> 8) & 0x03;
+ sprite._lineSize = ((sprite._flags >> 8) & 0x03) + 1;
sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
@@ -664,7 +664,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
byte spriteType = sp->_spriteType;
byte foreColor = sp->_foreColor;
byte backColor = sp->_backColor;
- int lineSize = sp->_lineSize - 1;
+ int lineSize = sp->_lineSize;
if (spriteType == kCastMemberSprite && sp->_cast != NULL) {
switch (sp->_cast->_type) {
case kCastShape:
@@ -688,7 +688,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
foreColor = sc->_fgCol;
backColor = sc->_bgCol;
- lineSize = sc->_lineThickness - 1;
+ lineSize = sc->_lineThickness;
ink = sc->_ink;
// shapes should be rendered with transparency by default
if (ink == kInkTypeCopy) {
@@ -702,6 +702,16 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
}
}
+ // for outlined shapes, line thickness of 1 means invisible.
+ // filled shapes need at least a line thickness of 1 for MacPlot to render them
+ if (spriteType == kOutlinedRectangleSprite ||
+ spriteType == kOutlinedRoundedRectangleSprite ||
+ spriteType == kOutlinedOvalSprite ||
+ spriteType == kLineBottomTopSprite ||
+ spriteType == kLineTopBottomSprite) {
+ lineSize -= 1;
+ }
+
Common::Rect shapeRect = Common::Rect(sp->_startPoint.x,
sp->_startPoint.y,
sp->_startPoint.x + sp->_width,
Commit: 2910e20a9209d544acf1c6e26c368d501de53cab
https://github.com/scummvm/scummvm/commit/2910e20a9209d544acf1c6e26c368d501de53cab
Author: Scott Percival (code at moral.net.au)
Date: 2020-01-05T11:35:40+08:00
Commit Message:
DIRECTOR: Re-add strange colour mapping for v3 and below
Changed paths:
engines/director/cast.cpp
engines/director/frame.cpp
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 8ec151c..4042f45 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 = 0xff - (uint8)stream.readByte();
- _bgCol = 0xff - (uint8)stream.readByte();
+ _fgCol = (127 - stream.readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ _bgCol = (127 - stream.readByte()) & 0xff;
_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 672e856..66cb7fd 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -197,8 +197,13 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
sprite._scriptId = stream->readByte();
sprite._spriteType = stream->readByte();
sprite._enabled = sprite._spriteType != 0;
- sprite._foreColor = 0xff - (uint8)stream->readByte();
- sprite._backColor = 0xff - (uint8)stream->readByte();
+ if (_vm->getVersion() >= 4) {
+ sprite._foreColor = 0xff - (uint8)stream->readByte();
+ sprite._backColor = 0xff - (uint8)stream->readByte();
+ } else {
+ sprite._foreColor = (127 - stream->readByte()) & 0xff; // -128 -> 0, 127 -> 256
+ sprite._backColor = (127 - stream->readByte()) & 0xff;
+ }
sprite._flags = stream->readUint16();
sprite._ink = static_cast<InkType>(sprite._flags & 0x3f);
Commit: 4b3a5257f5f5e848bc46c479b0b98e78b0f5cc18
https://github.com/scummvm/scummvm/commit/4b3a5257f5f5e848bc46c479b0b98e78b0f5cc18
Author: Scott Percival (code at moral.net.au)
Date: 2020-01-05T11:52:46+08:00
Commit Message:
DIRECTOR: Extend sprite line size to 3-bit
Changed paths:
engines/director/frame.cpp
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 66cb7fd..f50d31e 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -213,7 +213,7 @@ void Frame::readChannels(Common::ReadStreamEndian *stream) {
else
sprite._trails = 0;
- sprite._lineSize = ((sprite._flags >> 8) & 0x03) + 1;
+ sprite._lineSize = ((sprite._flags >> 8) & 0x07);
sprite._castId = stream->readUint16();
sprite._startPoint.y = stream->readUint16();
More information about the Scummvm-git-logs
mailing list