[Scummvm-git-logs] scummvm master -> 068d8791e8ecd0c47abb18fab1836dbe99cb9374

sev- sev at scummvm.org
Wed Jan 8 00:10:15 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:
068d8791e8 DIRECTOR: Invert button on mouse down


Commit: 068d8791e8ecd0c47abb18fab1836dbe99cb9374
    https://github.com/scummvm/scummvm/commit/068d8791e8ecd0c47abb18fab1836dbe99cb9374
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-08T01:09:55+01:00

Commit Message:
DIRECTOR: Invert button on mouse down

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 8d27eed..ad12406 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) {




More information about the Scummvm-git-logs mailing list