[Scummvm-cvs-logs] scummvm master -> b21f956790075f11fff4b43cecb8afca368594b3

bluegr md5 at scummvm.org
Fri Feb 17 20:13:13 CET 2012


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:
b21f956790 SCI: Fix and cleanup the monochrome cursor code


Commit: b21f956790075f11fff4b43cecb8afca368594b3
    https://github.com/scummvm/scummvm/commit/b21f956790075f11fff4b43cecb8afca368594b3
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-02-17T11:09:59-08:00

Commit Message:
SCI: Fix and cleanup the monochrome cursor code

This makes the code like FreeSCI again, which is the correct way to fix
bug #3487088.

Changed paths:
    engines/sci/graphics/cursor.cpp



diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp
index 1f7a2cf..b269e8b 100644
--- a/engines/sci/graphics/cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -125,21 +125,17 @@ void GfxCursor::kernelSetShape(GuiResourceId resourceId) {
 		error("cursor resource %d has invalid size", resourceId);
 
 	resourceData = resource->data;
-	// hotspot is specified for SCI1 cursors
-	hotspot.x = READ_LE_UINT16(resourceData);
-	hotspot.y = READ_LE_UINT16(resourceData + 2);
-	// bit 0 of resourceData[3] is set on <SCI1 games, which means center hotspot
-	if ((hotspot.x == 0) && (hotspot.y == 256))
-		hotspot.x = hotspot.y = SCI_CURSOR_SCI0_HEIGHTWIDTH / 2;
-	// LB1 defines bogus hotspot data for the busy cursor, which is fairly easy
-	// to detect, as the hotspot is defined outside the visible screen (!).
-	// Presumably, this was done to prevent the cursor from being usable, however
-	// the only thing that can be done when the wait cursor is shown is to skip
-	// scenes by left clicking. This bogus hotspot causes the cursor to not be
-	// drawn at all, thus we detect it and set the hotspot to (0, 0) instead.
-	// Fixes bug #3487088.
-	if (hotspot.x > _screen->getDisplayWidth())
-		hotspot.x = hotspot.y = 0;
+
+	if (getSciVersion() <= SCI_VERSION_0_LATE) {
+		// SCI0 cursors contain hotspot flags, not actual hotspot coordinates.
+		// If bit 0 of resourceData[3] is set, the hotspot should be centered,
+		// otherwise it's in the top left of the mouse cursor.
+		hotspot.x = hotspot.y = resourceData[3] ? SCI_CURSOR_SCI0_HEIGHTWIDTH / 2 : 0;
+	} else {
+		// Cursors in newer SCI versions contain actual hotspot coordinates.
+		hotspot.x = READ_LE_UINT16(resourceData);
+		hotspot.y = READ_LE_UINT16(resourceData + 2);
+	}
 
 	// Now find out what colors we are supposed to use
 	colorMapping[0] = 0; // Black is hardcoded






More information about the Scummvm-git-logs mailing list