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

svn-id: r20904
This commit is contained in:
Eugene Sandulenko 2006-02-26 03:03:59 +00:00
parent bd2a59787b
commit a3faba9727

View file

@ -1117,15 +1117,48 @@ void OSystem_SDL::setShakePos(int shake_pos) {
void OSystem_SDL::showOverlay() { void OSystem_SDL::showOverlay() {
assert (_transactionMode == kTransactionNone); assert (_transactionMode == kTransactionNone);
int x, y;
if (_overlayVisible)
return;
_overlayVisible = true; _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(); clearOverlay();
} }
void OSystem_SDL::hideOverlay() { void OSystem_SDL::hideOverlay() {
assert (_transactionMode == kTransactionNone); assert (_transactionMode == kTransactionNone);
if (!_overlayVisible)
return;
int x, y;
_overlayVisible = false; _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(); clearOverlay();
_forceFull = true; _forceFull = true;
} }