diff options
author | Torbjörn Andersson | 2015-06-03 19:19:05 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2015-06-03 19:19:05 +0200 |
commit | 08b81e38f3df177d67cf290b07b2bc4b041dfc34 (patch) | |
tree | 6a575181bb3dc59c8d93356b8d218de74917beb1 /engines | |
parent | 420e13a579c1fdb48fd26a6107d9f7a61c320625 (diff) | |
download | scummvm-rg350-08b81e38f3df177d67cf290b07b2bc4b041dfc34.tar.gz scummvm-rg350-08b81e38f3df177d67cf290b07b2bc4b041dfc34.tar.bz2 scummvm-rg350-08b81e38f3df177d67cf290b07b2bc4b041dfc34.zip |
SHERLOCK: Add hotspot to magnifying glass cursor
I am not sure exactly what the original did, but this seems to match
the behaviour I've observed in DOSBox.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/events.cpp | 16 | ||||
-rw-r--r-- | engines/sherlock/events.h | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index 216ef158a3..ec6863c2a8 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -64,14 +64,24 @@ void Events::setCursor(CursorId cursorId) { _cursorId = cursorId; + int hotspotX, hotspotY; + + if (cursorId == MAGNIFY) { + hotspotX = 8; + hotspotY = 8; + } else { + hotspotX = 0; + hotspotY = 0; + } + // Set the cursor data Graphics::Surface &s = (*_cursorImages)[cursorId]._frame; - setCursor(s); + setCursor(s, hotspotX, hotspotY); } -void Events::setCursor(const Graphics::Surface &src) { - CursorMan.replaceCursor(src.getPixels(), src.w, src.h, 0, 0, 0xff); +void Events::setCursor(const Graphics::Surface &src, int hotspotX, int hotspotY) { + CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff); showCursor(); } diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h index b35109fefe..653049f72a 100644 --- a/engines/sherlock/events.h +++ b/engines/sherlock/events.h @@ -75,7 +75,7 @@ public: /** * Set the cursor to show from a passed frame */ - void setCursor(const Graphics::Surface &src); + void setCursor(const Graphics::Surface &src, int hotspotX = 0, int hotspotY = 0); /** * Animates the mouse cursor if the Wait cursor is showing |