[Scummvm-git-logs] scummvm master -> 11b358691d78edbe48354afdcc150d1d841f5fe7

sev- sev at scummvm.org
Wed Feb 26 20:32:06 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:
11b358691d DIRECTOR: Fix button rendering


Commit: 11b358691d78edbe48354afdcc150d1d841f5fe7
    https://github.com/scummvm/scummvm/commit/11b358691d78edbe48354afdcc150d1d841f5fe7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-02-26T21:22:06+01:00

Commit Message:
DIRECTOR: Fix button rendering

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 00158d56e2..584421c502 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -810,6 +810,15 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
 
 	Common::Rect _rect;
 
+	Common::Rect textRect(0, 0, width, height);
+
+	// WORKAROUND, HACK
+	// Because we're not drawing text with transparency
+	// We swap drawing depending on whether the button is
+	// inverted or not, to prevent destroying the button
+	if (!invert)
+		renderText(surface, spriteId, &textRect);
+
 	switch (button->_buttonType) {
 	case kTypeCheckBox:
 		// Magic numbers: checkbox square need to move left about 5px from text and 12px side size (D4)
@@ -833,9 +842,8 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
 		break;
 	}
 
-	Common::Rect textRect(0, 0, width, height);
-	// pass the rect of the button into the label.
-	renderText(surface, spriteId, &textRect);
+	if (invert)
+		renderText(surface, spriteId, &textRect);
 }
 
 void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textRect) {




More information about the Scummvm-git-logs mailing list