From a3faba9727a5a3d43f2c6d08dc36d3bcd4f538f9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 26 Feb 2006 03:03:59 +0000 Subject: Fix bug #1349059: "SCUMM, GUI: Cursor jumps to incorrect position when pausing" svn-id: r20904 --- backends/sdl/graphics.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index cdbb23472e..138e70d279 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -1117,15 +1117,48 @@ void OSystem_SDL::setShakePos(int shake_pos) { 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; } -- cgit v1.2.3