diff options
author | Eugene Sandulenko | 2005-07-09 06:44:00 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-07-09 06:44:00 +0000 |
commit | aa13ccd6c3f5255ecb5e04dc92018876a9cabe96 (patch) | |
tree | dac9a519795463bed4abcc8780a313848dad419e /backends/sdl/graphics.cpp | |
parent | f8eb0bffdf5fe1aa5484e3ad6d253db4af815769 (diff) | |
download | scummvm-rg350-aa13ccd6c3f5255ecb5e04dc92018876a9cabe96.tar.gz scummvm-rg350-aa13ccd6c3f5255ecb5e04dc92018876a9cabe96.tar.bz2 scummvm-rg350-aa13ccd6c3f5255ecb5e04dc92018876a9cabe96.zip |
Commited patch to fix bug #1210836: "ALL: Failed assertion in AdvMame scaler".
Thanks cyx for actual fixing.
svn-id: r18520
Diffstat (limited to 'backends/sdl/graphics.cpp')
-rw-r--r-- | backends/sdl/graphics.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 82e431e4eb..606e58167a 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -1430,25 +1430,17 @@ void OSystem_SDL::toggleMouseGrab() { } void OSystem_SDL::undrawMouse() { + const int x = _mouseBackup.x; + const int y = _adjustAspectRatio ? aspect2Real(_mouseBackup.y) : _mouseBackup.y; + // When we switch bigger overlay off mouse jumps. Argh! - // this intended to prevent undrawing offscreen mouse - if (!_overlayVisible) { - if (_adjustAspectRatio) { - if (_mouseBackup.x > _screenWidth || aspect2Real(_mouseBackup.y) > _screenHeight) - return; - } else { - if (_mouseBackup.x > _screenWidth || _mouseBackup.y > _screenHeight) - return; - } + // This is intended to prevent undrawing offscreen mouse + if (!_overlayVisible && (x >= _screenWidth || y >= _screenHeight)) { + return; } - - if (_mouseBackup.w) { - if (_adjustAspectRatio) - addDirtyRect(_mouseBackup.x, aspect2Real(_mouseBackup.y), _mouseBackup.w, - _mouseBackup.h); - else - addDirtyRect(_mouseBackup.x, _mouseBackup.y, _mouseBackup.w, - _mouseBackup.h); + + if (_mouseBackup.w != 0 && _mouseBackup.h != 0) { + addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); } } |