aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-04-20 09:32:22 +0000
committerMax Horn2005-04-20 09:32:22 +0000
commit3f08f0bfb26b99e74ea689f4c2f773e663150ab4 (patch)
treef28310a7972582fb4ea973f8440ced56ee9fc506
parent901e76ea83ea6736c6d286f5e29c66408c968aba (diff)
downloadscummvm-rg350-3f08f0bfb26b99e74ea689f4c2f773e663150ab4.tar.gz
scummvm-rg350-3f08f0bfb26b99e74ea689f4c2f773e663150ab4.tar.bz2
scummvm-rg350-3f08f0bfb26b99e74ea689f4c2f773e663150ab4.zip
Fix bug 1184616 (GUI: Mouse drawn at wrong position in overlay mode)
svn-id: r17709
-rw-r--r--backends/sdl/graphics.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index 4c337ca526..6cd1cc94a1 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1410,18 +1410,14 @@ void OSystem_SDL::drawMouse() {
// scaling is determined by _scaleFactor, but *not* by whatever value
// _overlayScale has.
// Atop of that, it was scaled by _cursorTargetScale.
+ // That means, we have to scale it by "scale2".
//
- // TODO/FIXME: Clean up and fix this code, see also bug #1184616
- // and bug #1185275.
- // Part of the problem here is that we keep converting between different
- // scales and coordinate systems. In particular, we scale the top left
- // corner of the mouse cursor, instead of its center, which causes
- // it to be drawn in the wrong spot when scaled overlay mode is active.
+ // TODO/FIXME: Clean up and fix this code, see also bug #1185275.
const bool useScaling = (_scaleFactor > _cursorTargetScale);
- dst.x = _mouseCurState.x - _mouseHotspotX / _cursorTargetScale;
- dst.y = _mouseCurState.y - _mouseHotspotY / _cursorTargetScale;
+ dst.x = _mouseCurState.x - _mouseHotspotX * scale2 / _cursorTargetScale;
+ dst.y = _mouseCurState.y - _mouseHotspotY * scale2 / _cursorTargetScale;
dst.w = _mouseCurState.hW;
dst.h = _mouseCurState.hH;