aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-05-20 08:06:21 +0000
committerTorbjörn Andersson2006-05-20 08:06:21 +0000
commit87ee8db10d27e760f095e30db79ab14e9fb56ad9 (patch)
tree6567aad1e7a834854aee0fb9fd467b6fff5feb72 /backends
parent80eb6e4f5ea2b25864c94251f14e9b09170e72cf (diff)
downloadscummvm-rg350-87ee8db10d27e760f095e30db79ab14e9fb56ad9.tar.gz
scummvm-rg350-87ee8db10d27e760f095e30db79ab14e9fb56ad9.tar.bz2
scummvm-rg350-87ee8db10d27e760f095e30db79ab14e9fb56ad9.zip
Our GUI uses the "cursor palette" feature, but the SDL backend did not use the
cursor palette in overlay mode. Now it does, which fixes bug #1476666. The reason it worked at all before was that blitCursor() was called while still not in overlay mode. This, of course, means that the GUI can corrupt the in-game cursor palette. I don't have any game that uses this feature, so I don't know if it's properly restored again afterwards. But if it isn't, that should be fairly easy to fix. svn-id: r22539
Diffstat (limited to 'backends')
-rw-r--r--backends/sdl/graphics.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index afd28fddb0..269bdbc16d 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1062,8 +1062,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
_cursorHasOwnPalette = true;
_cursorPaletteDisabled = false;
- if (!_overlayVisible)
- blitCursor();
+ blitCursor();
}
void OSystem_SDL::setShakePos(int shake_pos) {
@@ -1332,18 +1331,19 @@ void OSystem_SDL::blitCursor() {
// Draw from [1,1] since AdvMame2x adds artefact at 0,0
dstPtr = (byte *)_mouseOrigSurface->pixels + _mouseOrigSurface->pitch + 2;
+ SDL_Color *palette;
+
+ if (_cursorHasOwnPalette && !_cursorPaletteDisabled)
+ palette = _cursorPalette;
+ else
+ palette = _currentPalette;
+
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
color = *srcPtr;
if (color != _mouseKeyColor) { // transparent, don't draw
- if (_cursorHasOwnPalette && !_overlayVisible && !_cursorPaletteDisabled)
- *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
- _cursorPalette[color].r, _cursorPalette[color].g,
- _cursorPalette[color].b);
- else
- *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
- _currentPalette[color].r, _currentPalette[color].g,
- _currentPalette[color].b);
+ *(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
+ palette[color].r, palette[color].g, palette[color].b);
}
dstPtr += 2;
srcPtr++;