aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-05-20 09:27:56 +0000
committerTorbjörn Andersson2006-05-20 09:27:56 +0000
commit407cb66502ef9e1cf964357fad5e0a67c36b4828 (patch)
tree61798994d49dd494ec268d837d3830766a935bf1 /backends
parent22fb1e48ef192c331c224593e73fb817a2e582c0 (diff)
downloadscummvm-rg350-407cb66502ef9e1cf964357fad5e0a67c36b4828.tar.gz
scummvm-rg350-407cb66502ef9e1cf964357fad5e0a67c36b4828.tar.bz2
scummvm-rg350-407cb66502ef9e1cf964357fad5e0a67c36b4828.zip
Re-render the cursor when enabling/disabling cursor palette. Also, I don't
think _cursorHasOwnPalette is needed any more, so I've removed it. svn-id: r22541
Diffstat (limited to 'backends')
-rw-r--r--backends/sdl/graphics.cpp10
-rw-r--r--backends/sdl/sdl-common.h6
-rw-r--r--backends/sdl/sdl.cpp2
3 files changed, 10 insertions, 8 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index 269bdbc16d..e9bffb0be0 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1031,7 +1031,7 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
_paletteDirtyEnd = start + num;
// Some games blink cursors with palette
- if (!_overlayVisible && (!_cursorHasOwnPalette || _cursorPaletteDisabled))
+ if (_cursorPaletteDisabled)
blitCursor();
}
@@ -1048,6 +1048,7 @@ void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) {
}
void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
+ printf("setCursorPalette\n");
assert(colors);
const byte *b = colors;
uint i;
@@ -1059,7 +1060,6 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
b += 4;
}
- _cursorHasOwnPalette = true;
_cursorPaletteDisabled = false;
blitCursor();
@@ -1333,10 +1333,10 @@ void OSystem_SDL::blitCursor() {
SDL_Color *palette;
- if (_cursorHasOwnPalette && !_cursorPaletteDisabled)
- palette = _cursorPalette;
- else
+ if (_cursorPaletteDisabled)
palette = _currentPalette;
+ else
+ palette = _cursorPalette;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h
index 668858c0b4..3e01a59510 100644
--- a/backends/sdl/sdl-common.h
+++ b/backends/sdl/sdl-common.h
@@ -102,7 +102,10 @@ public:
void setCursorPalette(const byte *colors, uint start, uint num);
// Disables or enables cursor palette
- void disableCursorPalette(bool disable) { _cursorPaletteDisabled = disable; };
+ void disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+ blitCursor();
+ };
// Shaking is used in SCUMM. Set current shake position.
void setShakePos(int shake_pos);
@@ -304,7 +307,6 @@ protected:
int16 _mouseHotspotY;
byte _mouseKeyColor;
int _cursorTargetScale;
- bool _cursorHasOwnPalette;
bool _cursorPaletteDisabled;
SDL_Surface *_mouseOrigSurface;
SDL_Surface *_mouseSurface;
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp
index 3c82765c1b..3209a6dc3d 100644
--- a/backends/sdl/sdl.cpp
+++ b/backends/sdl/sdl.cpp
@@ -181,7 +181,7 @@ OSystem_SDL::OSystem_SDL()
_cdrom(0), _scalerProc(0), _modeChanged(false), _dirtyChecksums(0),
_mouseVisible(false), _mouseDrawn(false), _mouseData(0), _mouseSurface(0),
_mouseOrigSurface(0), _mouseHotspotX(0), _mouseHotspotY(0), _cursorTargetScale(1),
- _cursorHasOwnPalette(false), _cursorPaletteDisabled(true),
+ _cursorPaletteDisabled(true),
_joystick(0),
_currentShakePos(0), _newShakePos(0),
_paletteDirtyStart(0), _paletteDirtyEnd(0),