diff options
author | Filippos Karapetis | 2012-02-17 21:09:59 +0200 |
---|---|---|
committer | Filippos Karapetis | 2012-02-17 21:09:59 +0200 |
commit | b21f956790075f11fff4b43cecb8afca368594b3 (patch) | |
tree | feeddec191228999d1a82aeb55a5860f30b59e4e /engines/sci | |
parent | c48ad37244e3706972b538616d0c0ce6653b4c68 (diff) | |
download | scummvm-rg350-b21f956790075f11fff4b43cecb8afca368594b3.tar.gz scummvm-rg350-b21f956790075f11fff4b43cecb8afca368594b3.tar.bz2 scummvm-rg350-b21f956790075f11fff4b43cecb8afca368594b3.zip |
SCI: Fix and cleanup the monochrome cursor code
This makes the code like FreeSCI again, which is the correct way to fix
bug #3487088.
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 26 |
1 files 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 <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 |