diff options
author | Eugene Sandulenko | 2019-12-25 14:52:13 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-25 14:52:13 +0100 |
commit | 197bc172164152a7e3af4f7048a2c0ef8fc9bf3e (patch) | |
tree | 7b5689d1792b765f5e7f2100149b5c9b1e479692 /engines | |
parent | 3f392ca564be429715db75e89803dd6aa431798e (diff) | |
download | scummvm-rg350-197bc172164152a7e3af4f7048a2c0ef8fc9bf3e.tar.gz scummvm-rg350-197bc172164152a7e3af4f7048a2c0ef8fc9bf3e.tar.bz2 scummvm-rg350-197bc172164152a7e3af4f7048a2c0ef8fc9bf3e.zip |
DIRECTOR: Correctly use ink information for sprites
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/cast.cpp | 3 | ||||
-rw-r--r-- | engines/director/cast.h | 1 | ||||
-rw-r--r-- | engines/director/frame.cpp | 3 | ||||
-rw-r--r-- | engines/director/sprite.h | 22 | ||||
-rw-r--r-- | engines/director/types.h | 21 |
5 files changed, 27 insertions, 23 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index 804bd58a8a..7c7604b21f 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -251,6 +251,8 @@ void TextCast::setText(const char *text) { ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { byte flags, unk1; + _ink = kInkTypeCopy; + if (version < 4) { flags = stream.readByte(); unk1 = stream.readByte(); @@ -260,6 +262,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) { _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(); _lineDirection = stream.readByte(); } else { diff --git a/engines/director/cast.h b/engines/director/cast.h index 66cb77ffe7..9a407e5be6 100644 --- a/engines/director/cast.h +++ b/engines/director/cast.h @@ -79,6 +79,7 @@ public: byte _fillType; byte _lineThickness; byte _lineDirection; + InkType _ink; }; class TextCast : public Cast { diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 8bd1f45535..a50933fbc5 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -588,6 +588,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { case kRectangleSprite: case kOutlinedRectangleSprite: // this is actually a mouse-over shape? I don't think it's a real button. case kCastMemberSprite: // Face kit D3 + case kLineTopBottomSprite: castType = kCastShape; break; case kTextSprite: @@ -655,6 +656,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { if (sp->_shapeCast != NULL) { sp->_foreColor = sp->_shapeCast->_fgCol; sp->_backColor = sp->_shapeCast->_bgCol; + sp->_ink = sp->_shapeCast->_ink; } Common::Rect shapeRect = Common::Rect(sp->_startPoint.x, @@ -668,7 +670,6 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) { tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff)); //tmpSurface.frameRect(Common::Rect(shapeRect.width(), shapeRect.height()), 0); // TODO: don't override, work out how to display correctly. - sp->_ink = kInkTypeReverse; } else { // No minus one on the pattern here! MacPlotData will do that for us! Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->_castId, 1, sp->_backColor); diff --git a/engines/director/sprite.h b/engines/director/sprite.h index c7c2ad091a..f37f1c84ea 100644 --- a/engines/director/sprite.h +++ b/engines/director/sprite.h @@ -30,28 +30,6 @@ class ButtonCast; class ShapeCast; class TextCast; -enum InkType { - kInkTypeCopy, - kInkTypeTransparent, - kInkTypeReverse, - kInkTypeGhost, - kInkTypeNotCopy, - kInkTypeNotTrans, - kInkTypeNotReverse, - kInkTypeNotGhost, - kInkTypeMatte, - kInkTypeMask, - //10-31 Not used (Lingo in a Nutshell) - kInkTypeBlend = 32, - kInkTypeAddPin, - kInkTypeAdd, - kInkTypeSubPin, - kInkTypeBackgndTrans, - kInkTypeLight, - kInkTypeSub, - kInkTypeDark -}; - enum SpritePosition { kSpritePositionUnk1 = 0, kSpritePositionEnabled, diff --git a/engines/director/types.h b/engines/director/types.h index 708718b9b9..dad660d08c 100644 --- a/engines/director/types.h +++ b/engines/director/types.h @@ -113,6 +113,27 @@ enum SpriteType { kDirMovieSprite = 18 }; +enum InkType { + kInkTypeCopy, + kInkTypeTransparent, + kInkTypeReverse, + kInkTypeGhost, + kInkTypeNotCopy, + kInkTypeNotTrans, + kInkTypeNotReverse, + kInkTypeNotGhost, + kInkTypeMatte, + kInkTypeMask, + //10-31 Not used (Lingo in a Nutshell) + kInkTypeBlend = 32, + kInkTypeAddPin, + kInkTypeAdd, + kInkTypeSubPin, + kInkTypeBackgndTrans, + kInkTypeLight, + kInkTypeSub, + kInkTypeDark +}; const char *scriptType2str(ScriptType scr); |