Implement OSystem method disableCursorPalette(bool disable) as mentioned

in patch #1013937 (OSystem layer with bigger resolution).

svn-id: r16820
This commit is contained in:
Eugene Sandulenko 2005-02-20 02:04:45 +00:00
parent 47400c1932
commit f420dd3b78
4 changed files with 20 additions and 3 deletions

View File

@ -870,7 +870,7 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
_paletteDirtyEnd = start + num;
// Some games blink cursors with palette
if (!_overlayVisible && !_cursorHasOwnPalette)
if (!_overlayVisible && (!_cursorHasOwnPalette || _cursorPaletteDisabled))
blitCursor();
}
@ -886,6 +886,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
}
_cursorHasOwnPalette = true;
_cursorPaletteDisabled = false;
if (!_overlayVisible)
blitCursor();
@ -1126,7 +1127,7 @@ void OSystem_SDL::blitCursor() {
for (j = 0; j < w; j++) {
color = *srcPtr;
if (color != _mouseKeyColor) { // transparent, don't draw
if (_cursorHasOwnPalette && !_overlayVisible)
if (_cursorHasOwnPalette && !_overlayVisible && !_cursorPaletteDisabled)
*(uint16 *)dstPtr = SDL_MapRGB(_mouseOrigSurface->format,
_cursorPalette[color].r, _cursorPalette[color].g,
_cursorPalette[color].b);

View File

@ -87,6 +87,9 @@ public:
// Set colors of cursor palette
void setCursorPalette(const byte *colors, uint start, uint num);
// Disables or enables cursor palette
void disableCursorPalette(bool disable) { _cursorPaletteDisabled = disable; };
// Shaking is used in SCUMM. Set current shake position.
void setShakePos(int shake_pos);
@ -277,6 +280,7 @@ protected:
byte _mouseKeyColor;
int _cursorTargetScale;
bool _cursorHasOwnPalette;
bool _cursorPaletteDisabled;
SDL_Surface *_mouseOrigSurface;
SDL_Surface *_mouseSurface;
enum {

View File

@ -102,7 +102,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),
_cursorHasOwnPalette(false), _cursorPaletteDisabled(true),
_joystick(0),
_currentShakePos(0), _newShakePos(0),
_paletteDirtyStart(0), _paletteDirtyEnd(0),

View File

@ -293,6 +293,18 @@ public:
*/
virtual void setCursorPalette(const byte *colors, uint start, uint num) {};
/**
* Disable or enable cursor palette.
*
* Backends which implement it should have kFeatureCursorHasPalette flag set
*
* @param disable True to disable, false to enable.
*
* @see setPalette
* @see kFeatureCursorHasPalette
*/
virtual void disableCursorPalette(bool disable) {};
/**
* Blit a bitmap to the virtual screen.
* The real screen will not immediately be updated to reflect the changes.