diff options
author | Eugene Sandulenko | 2006-02-26 03:03:59 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-02-26 03:03:59 +0000 |
commit | a3faba9727a5a3d43f2c6d08dc36d3bcd4f538f9 (patch) | |
tree | 7f424369d28446e01d37d72c98f4d36da36e2b5c | |
parent | bd2a59787b86f76d8cbc6272bcda7f69fa179bc5 (diff) | |
download | scummvm-rg350-a3faba9727a5a3d43f2c6d08dc36d3bcd4f538f9.tar.gz scummvm-rg350-a3faba9727a5a3d43f2c6d08dc36d3bcd4f538f9.tar.bz2 scummvm-rg350-a3faba9727a5a3d43f2c6d08dc36d3bcd4f538f9.zip |
Fix bug #1349059: "SCUMM, GUI: Cursor jumps to incorrect position when pausing"
svn-id: r20904
-rw-r--r-- | backends/sdl/graphics.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
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; } |