aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2020-01-08 01:09:55 +0100
committerEugene Sandulenko2020-01-08 01:09:55 +0100
commit068d8791e8ecd0c47abb18fab1836dbe99cb9374 (patch)
treed38c3084a659675b6acc63c7b13708384451d8de /engines/director
parentc4780d2befd15dbd66ac54de4a18f29fbc7acd93 (diff)
downloadscummvm-rg350-068d8791e8ecd0c47abb18fab1836dbe99cb9374.tar.gz
scummvm-rg350-068d8791e8ecd0c47abb18fab1836dbe99cb9374.tar.bz2
scummvm-rg350-068d8791e8ecd0c47abb18fab1836dbe99cb9374.zip
DIRECTOR: Invert button on mouse down
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/frame.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 8d27eed5de..ad12406a6d 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -781,9 +781,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
int height = button->_initialRect.height();
int width = button->_initialRect.width() + 3;
- Common::Rect textRect(0, 0, width, height);
- // pass the rect of the button into the label.
- renderText(surface, spriteId, &textRect);
+ bool invert = spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId;
// TODO: review all cases to confirm if we should use text height.
// height = textRect.height();
@@ -799,8 +797,9 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
break;
case kTypeButton: {
_rect = Common::Rect(x, y, x + width, y + height + 3);
- Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, Graphics::kColorWhite);
- Graphics::drawRoundRect(_rect, 4, 0, false, Graphics::macDrawPixel, &pd);
+ Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite);
+
+ Graphics::drawRoundRect(_rect, 4, 0, invert, Graphics::macDrawPixel, &pd);
addDrawRect(spriteId, _rect);
}
break;
@@ -811,6 +810,10 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
warning("renderButton: Unknown buttonType");
break;
}
+
+ Common::Rect textRect(0, 0, width, height);
+ // pass the rect of the button into the label.
+ renderText(surface, spriteId, &textRect);
}
void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) {
@@ -933,7 +936,12 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
textWithFeatures.transBlitFrom(textSurface->rawSurface(), Common::Point(textX, textY), 0xff);
- inkBasedBlit(surface, textWithFeatures, _sprites[spriteId]->_ink, Common::Rect(x, y, x + width, y + height));
+ InkType ink = _sprites[spriteId]->_ink;
+
+ if (spriteId == _vm->getCurrentScore()->_currentMouseDownSpriteId)
+ ink = kInkTypeReverse;
+
+ inkBasedBlit(surface, textWithFeatures, ink, Common::Rect(x, y, x + width, y + height));
}
void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics::Surface &spriteSurface, InkType ink, Common::Rect drawRect) {