[Scummvm-cvs-logs] SF.net SVN: scummvm: [20904] scummvm/trunk/backends/sdl/graphics.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Feb 25 19:05:04 CET 2006


Revision: 20904
Author:   sev
Date:     2006-02-25 19:03:59 -0800 (Sat, 25 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20904&view=rev

Log Message:
-----------
Fix bug #1349059: "SCUMM, GUI: Cursor jumps to incorrect position when pausing"

Modified Paths:
--------------
    scummvm/trunk/backends/sdl/graphics.cpp
Modified: scummvm/trunk/backends/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/sdl/graphics.cpp	2006-02-26 02:23:59 UTC (rev 20903)
+++ scummvm/trunk/backends/sdl/graphics.cpp	2006-02-26 03:03:59 UTC (rev 20904)
@@ -1117,15 +1117,48 @@
 void OSystem_SDL::showOverlay() {
 	assert (_transactionMode == kTransactionNone);
 
+	int x, y;
+
+	if (_overlayVisible)
+		return;
+
 	_overlayVisible = true;
+
+	// Since resolution could change, put mouse to adjusted position
+	// Fixes bug #1349059
+	x = _mouseCurState.x * _overlayScale;
+	y = _mouseCurState.y * _overlayScale;
+
+	if (_adjustAspectRatio)
+		y = real2Aspect(y);
+
+	warpMouse(x, y);
+
 	clearOverlay();
 }
 
 void OSystem_SDL::hideOverlay() {
 	assert (_transactionMode == kTransactionNone);
 
+	if (!_overlayVisible)
+		return;
+
+	int x, y;
+
 	_overlayVisible = false;
+
+	// Since resolution could change, put mouse to adjusted position
+	// Fixes bug #1349059
+	x = _mouseCurState.x / _overlayScale;
+	y = _mouseCurState.y / _overlayScale;
+
+	if (_adjustAspectRatio)
+		y = real2Aspect(y);
+
+	warpMouse(x, y);
+
 	clearOverlay();
+
 	_forceFull = true;
 }
 







More information about the Scummvm-git-logs mailing list