aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorScott Percival2020-01-04 11:57:05 +0800
committerScott Percival2020-01-04 11:57:05 +0800
commit303ee2694f4e85d3d9796068e33d2d48ca100e8a (patch)
tree1f4f3a52a7308560bcfb279dd14ba5534d1775e3 /engines/director
parent7e6c925a683d185f81d1da8b9806270f56040ed2 (diff)
downloadscummvm-rg350-303ee2694f4e85d3d9796068e33d2d48ca100e8a.tar.gz
scummvm-rg350-303ee2694f4e85d3d9796068e33d2d48ca100e8a.tar.bz2
scummvm-rg350-303ee2694f4e85d3d9796068e33d2d48ca100e8a.zip
DIRECTOR: Inherit color, line size and pattern from shape cast
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/frame.cpp26
-rw-r--r--engines/director/sprite.cpp11
2 files changed, 24 insertions, 13 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 3de87f6fd8..b73146a771 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -661,6 +661,9 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
Sprite *sp = _sprites[spriteId];
byte spriteType = sp->_spriteType;
+ byte foreColor = sp->_foreColor;
+ byte backColor = sp->_backColor;
+ byte lineSize = sp->_lineSize + 1;
if (spriteType == kCastMemberSprite && sp->_cast != NULL) {
switch (sp->_cast->_type) {
case kCastShape:
@@ -677,11 +680,14 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
spriteType = sc->_fillType ? kOvalSprite : kOutlinedOvalSprite;
break;
case kShapeLine:
- spriteType = sc->_lineDirection == 6 ? kLineTopBottomSprite : kLineBottomTopSprite;
+ spriteType = sc->_lineDirection == 6 ? kLineBottomTopSprite : kLineTopBottomSprite;
break;
default:
break;
}
+ foreColor = sc->_fgCol;
+ backColor = sc->_bgCol;
+ lineSize = sc->_lineThickness;
}
break;
default:
@@ -700,37 +706,37 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
// No minus one on the pattern here! MacPlotData will do that for us!
//Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), 1, 1, sp->_backColor);
- Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), sp->_lineSize + 1, sp->_backColor);
+ Graphics::MacPlotData pd(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), lineSize, backColor);
Common::Rect fillRect(shapeRect.width(), shapeRect.height());
switch (spriteType) {
case kRectangleSprite:
- Graphics::drawFilledRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
break;
case kRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, sp->_foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(fillRect, 4, foreColor, true, Graphics::macDrawPixel, &pd);
break;
case kOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, sp->_foreColor, true, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, true, Graphics::macDrawPixel, &pd);
break;
case kLineTopBottomSprite:
- Graphics::drawLine(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, sp->_foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, Graphics::macDrawPixel, &pd);
break;
case kLineBottomTopSprite:
- Graphics::drawLine(fillRect.left, fillRect.bottom, fillRect.right, fillRect.top, sp->_foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawLine(fillRect.left, fillRect.bottom, fillRect.right, fillRect.top, foreColor, Graphics::macDrawPixel, &pd);
break;
case kOutlinedRectangleSprite: // this is actually a mouse-over shape? I don't think it's a real button.
//Graphics::drawRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
tmpSurface.fillRect(Common::Rect(shapeRect.width(), shapeRect.height()), (_vm->getCurrentScore()->_currentMouseDownSpriteId == spriteId ? 0 : 0xff));
break;
case kOutlinedRoundedRectangleSprite:
- Graphics::drawRoundRect(fillRect, 4, sp->_foreColor, false, Graphics::macDrawPixel, &pd);
+ Graphics::drawRoundRect(fillRect, 4, foreColor, false, Graphics::macDrawPixel, &pd);
break;
case kOutlinedOvalSprite:
- Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, sp->_foreColor, false, Graphics::macDrawPixel, &pd);
+ Graphics::drawEllipse(fillRect.left, fillRect.top, fillRect.right, fillRect.bottom, foreColor, false, Graphics::macDrawPixel, &pd);
break;
case kCastMemberSprite: // Face kit D3
- Graphics::drawFilledRect(fillRect, sp->_foreColor, Graphics::macDrawPixel, &pd);
+ Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &pd);
break;
default:
warning("Frame::renderShape(): Unhandled sprite type: %d", sp->_spriteType);
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index 3fd5b6a470..d9f8291761 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -121,9 +121,14 @@ uint16 Sprite::getPattern() {
return _castId;
case kCastMemberSprite:
- // TODO. Check type being shape, and return its pattern
- warning("Sprite::getPattern(): kCastMemberSprite");
- return 0;
+ switch (_cast->_type) {
+ case kCastShape:
+ return ((ShapeCast *)_cast)->_pattern;
+ break;
+ default:
+ warning("Sprite::getPattern(): Unhandled cast type: %d", _cast->_type);
+ break;
+ }
default:
return 0;