aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-03-17 09:49:22 +0000
committerTorbjörn Andersson2005-03-17 09:49:22 +0000
commit4c3d302e19e9435e3fad3ff1f71f73b541f641ae (patch)
tree64df71d666d91af38bb41d95bc9befa084120bd0
parent31c89144dc6ef8b2cf05883bbf8aea6426301e38 (diff)
downloadscummvm-rg350-4c3d302e19e9435e3fad3ff1f71f73b541f641ae.tar.gz
scummvm-rg350-4c3d302e19e9435e3fad3ff1f71f73b541f641ae.tar.bz2
scummvm-rg350-4c3d302e19e9435e3fad3ff1f71f73b541f641ae.zip
If a game is scaled with the 2x or 3x scaler, use the same scaler on the
cursor as well. It looks strange if the game is blocky and the cursor is smooth. svn-id: r17173
-rw-r--r--backends/sdl/graphics.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index 05307b0565..23b84460c6 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1288,9 +1288,21 @@ void OSystem_SDL::blitCursor() {
}
SDL_LockSurface(_mouseSurface);
- (scalersMagn[_cursorTargetScale-1][_scaleFactor-1])((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2,
+
+ ScalerProc *scalerProc;
+
+ // If possible, use the same scaler for the cursor as for the rest of
+ // the game. This only works well with the non-blurring scalers so we
+ // actually only use the 1x, 1.5x, 2x and AdvMame scalers.
+
+ if (_cursorTargetScale == 1 && (_mode == GFX_DOUBLESIZE || _mode == GFX_TRIPLESIZE))
+ scalerProc = _scalerProc;
+ else
+ scalerProc = scalersMagn[_cursorTargetScale - 1][_scaleFactor - 1];
+
+ scalerProc((byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2,
_mouseOrigSurface->pitch, (byte *)_mouseSurface->pixels, _mouseSurface->pitch,
- _mouseCurState.w, _mouseCurState.h);
+ _mouseCurState.w, _mouseCurState.h);
if (_adjustAspectRatio)
cursorStretch200To240((uint8 *)_mouseSurface->pixels, _mouseSurface->pitch, hW, hH1, 0, 0, 0);