From b21f956790075f11fff4b43cecb8afca368594b3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 17 Feb 2012 21:09:59 +0200 Subject: SCI: Fix and cleanup the monochrome cursor code This makes the code like FreeSCI again, which is the correct way to fix bug #3487088. --- engines/sci/graphics/cursor.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 1f7a2cfdbb..b269e8ba51 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 _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 -- cgit v1.2.3