[Scummvm-cvs-logs] CVS: scummvm/backends/sdl graphics.cpp,1.41,1.42

Max Horn fingolfin at users.sourceforge.net
Wed Apr 20 02:32:45 CEST 2005


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1933

Modified Files:
	graphics.cpp 
Log Message:
Fix bug 1184616 (GUI: Mouse drawn at wrong position in overlay mode)

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- graphics.cpp	20 Apr 2005 09:24:29 -0000	1.41
+++ graphics.cpp	20 Apr 2005 09:32:22 -0000	1.42
@@ -1410,18 +1410,14 @@
 	// 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;





More information about the Scummvm-git-logs mailing list