From 28d1fdcf24861485bbbd7ae537fdf13c6da721e4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 26 Feb 2009 02:04:30 +0000 Subject: - Fix cursor drawing bug on (cursor) palette change - Fix cursor drawing when it was hidden before and no dirty rects are present - Diese und die folgenden Zeilen werden ignoriert -- M sdl/graphics.cpp svn-id: r38890 --- backends/platform/sdl/graphics.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index cd8b91a8e2..879537f2cd 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -667,8 +667,7 @@ void OSystem_SDL::internUpdateScreen() { } // Only draw anything if necessary - if (_numDirtyRects > 0) { - + if (_numDirtyRects > 0 || _mouseNeedsRedraw) { SDL_Rect *r; SDL_Rect dst; uint32 srcPitch, dstPitch; @@ -744,7 +743,6 @@ void OSystem_SDL::internUpdateScreen() { _numDirtyRects = 0; _forceFull = false; - _mouseNeedsRedraw = false; } bool OSystem_SDL::saveScreenshot(const char *filename) { @@ -1315,7 +1313,6 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, if (w == 0 || h == 0) return; - _mouseNeedsRedraw = true; _mouseCurState.hotX = hotspot_x; _mouseCurState.hotY = hotspot_y; @@ -1361,6 +1358,8 @@ void OSystem_SDL::blitCursor() { if (!_mouseOrigSurface || !_mouseData) return; + _mouseNeedsRedraw = true; + w = _mouseCurState.w; h = _mouseCurState.h; @@ -1531,9 +1530,8 @@ void OSystem_SDL::undrawMouse() { // When we switch bigger overlay off mouse jumps. Argh! // This is intended to prevent undrawing offscreen mouse - if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) { + if (!_overlayVisible && (x >= _videoMode.screenWidth || y >= _videoMode.screenHeight)) return; - } if (_mouseBackup.w != 0 && _mouseBackup.h != 0) addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h); -- cgit v1.2.3