[Scummvm-git-logs] scummvm master -> c662829449292c75ae31950f8263aaca7685b895

sev- noreply at scummvm.org
Tue Apr 4 14:11:09 UTC 2023


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:
c662829449 SCUMM: Fix Windows cursor mask regression.


Commit: c662829449292c75ae31950f8263aaca7685b895
    https://github.com/scummvm/scummvm/commit/c662829449292c75ae31950f8263aaca7685b895
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-04T16:11:04+02:00

Commit Message:
SCUMM: Fix Windows cursor mask regression.

Changed paths:
    engines/scumm/he/resource_he.cpp


diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index ba3ea020a18..44648426c71 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -144,9 +144,12 @@ bool Win32ResExtractor::extractResource(int id, CachedCursor *cc) {
 
 	// Convert from the paletted format to the SCUMM palette
 	const byte *srcBitmap = cursor->getSurface();
+	const byte *srcMask = cursor->getMask();
 
 	for (int i = 0; i < cursor->getWidth() * cursor->getHeight(); i++) {
-		if (srcBitmap[i] == cursor->getKeyColor()) // Transparent
+		const bool isTransparent = (srcMask ? (srcMask[i] != kCursorMaskOpaque) : (srcBitmap[i] == cursor->getKeyColor()));
+
+		if (isTransparent)
 			cc->bitmap[i] = 255;
 		else if (srcBitmap[i] == 0)                // Black
 			cc->bitmap[i] = 253;




More information about the Scummvm-git-logs mailing list