[Scummvm-git-logs] scummvm master -> 22cb3a4d40435788483a4d7c0bb39bbf2291b561

djsrv dservilla at gmail.com
Sun Jul 11 06:08:46 UTC 2021


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:
22cb3a4d40 DIRECTOR: Reorder autohilite logic


Commit: 22cb3a4d40435788483a4d7c0bb39bbf2291b561
    https://github.com/scummvm/scummvm/commit/22cb3a4d40435788483a4d7c0bb39bbf2291b561
Author: djsrv (dservilla at gmail.com)
Date: 2021-07-11T02:04:25-04:00

Commit Message:
DIRECTOR: Reorder autohilite logic

These checks apparently need to be done in a specific order. If in D3 no
cast info is found, the auto hilite check cannot be performed, so it
falls back to the matte check.

Changed paths:
    engines/director/sprite.cpp


diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index 28d183fd6b..552d73c65b 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -126,23 +126,31 @@ bool Sprite::shouldHilite() {
 	if (_puppet)
 		return false;
 
-	if (_ink == kInkTypeMatte) {
-		if (g_director->getCurrentMovie()->_version < kFileVer300)
-			return true;
-		if (isQDShape())
-			return true;
-	}
-
 	if (_cast) {
-		// we have our own check for button, thus we don't need it here
-		if (_cast->_type == kCastButton)
+		// Restrict to bitmap cast members.
+		// Buttons also hilite on click, but they have their own check.
+		if (_cast->_type != kCastBitmap)
+			return false;
+
+		if (g_director->getVersion() >= 300) {
+			// The Auto Hilite flag was introduced in D3.
+
+			CastMemberInfo *castInfo = _cast->getInfo();
+			if (castInfo)
+				return castInfo->autoHilite;
+
+			// If there's no cast info, fall back to the old matte check.
+			// In D4 or above, there should always be a cast info,
+			// but in D3, it is not present unless you set a cast member's
+			// name, script, etc.
+		}
+	} else {
+		// QuickDraw shapes may also hilite on click.
+		if (!isQDShape())
 			return false;
-		CastMemberInfo *castInfo = _cast->getInfo();
-		if (castInfo)
-			return castInfo->autoHilite;
 	}
 
-	return false;
+	return _ink == kInkTypeMatte;
 }
 
 uint16 Sprite::getPattern() {




More information about the Scummvm-git-logs mailing list