[Scummvm-cvs-logs] scummvm master -> 08b81e38f3df177d67cf290b07b2bc4b041dfc34
eriktorbjorn
eriktorbjorn at telia.com
Wed Jun 3 19:21:08 CEST 2015
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:
08b81e38f3 SHERLOCK: Add hotspot to magnifying glass cursor
Commit: 08b81e38f3df177d67cf290b07b2bc4b041dfc34
https://github.com/scummvm/scummvm/commit/08b81e38f3df177d67cf290b07b2bc4b041dfc34
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-06-03T19:19:05+02:00
Commit Message:
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.
Changed paths:
engines/sherlock/events.cpp
engines/sherlock/events.h
diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 216ef15..ec6863c 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 b35109f..653049f 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
More information about the Scummvm-git-logs
mailing list