mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-24 18:56:33 +00:00
Streamlined the cursor blitting changes introduced in revision 41412
svn-id: r41213
This commit is contained in:
parent
4087a3e6e8
commit
0323638ce9
@ -332,11 +332,7 @@ void OSystem_SDL::setGraphicsModeIntern() {
|
||||
|
||||
// Even if the old and new scale factors are the same, we may have a
|
||||
// different scaler for the cursor now.
|
||||
#ifdef ENABLE_16BIT
|
||||
blitCursor(_cursorBitDepth);
|
||||
#else
|
||||
blitCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
int OSystem_SDL::getGraphicsMode() const {
|
||||
@ -604,11 +600,7 @@ bool OSystem_SDL::hotswapGFXMode() {
|
||||
SDL_FreeSurface(old_overlayscreen);
|
||||
|
||||
// Update cursor to new scale
|
||||
#ifdef ENABLE_16BIT
|
||||
blitCursor(_cursorBitDepth);
|
||||
#else
|
||||
blitCursor();
|
||||
#endif
|
||||
|
||||
// Blit everything to the screen
|
||||
internUpdateScreen();
|
||||
@ -1171,11 +1163,7 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
|
||||
|
||||
// Some games blink cursors with palette
|
||||
if (_cursorPaletteDisabled)
|
||||
#ifdef ENABLE_16BIT
|
||||
blitCursor(_cursorBitDepth);
|
||||
#else
|
||||
blitCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) {
|
||||
@ -1204,11 +1192,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
|
||||
|
||||
_cursorPaletteDisabled = false;
|
||||
|
||||
#ifdef ENABLE_16BIT
|
||||
blitCursor(_cursorBitDepth);
|
||||
#else
|
||||
blitCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
void OSystem_SDL::setShakePos(int shake_pos) {
|
||||
@ -1469,21 +1453,15 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
|
||||
#ifdef ENABLE_16BIT
|
||||
_mouseData = (byte *)malloc(w * h * byteDepth);
|
||||
memcpy(_mouseData, buf, w * h * byteDepth);
|
||||
|
||||
blitCursor(bitDepth);
|
||||
#else
|
||||
_mouseData = (byte *)malloc(w * h);
|
||||
memcpy(_mouseData, buf, w * h);
|
||||
#endif
|
||||
|
||||
blitCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_16BIT
|
||||
void OSystem_SDL::blitCursor(uint8 bitDepth) {
|
||||
#else
|
||||
void OSystem_SDL::blitCursor() {
|
||||
#endif
|
||||
byte *dstPtr;
|
||||
const byte *srcPtr = _mouseData;
|
||||
byte color;
|
||||
@ -1522,7 +1500,7 @@ void OSystem_SDL::blitCursor() {
|
||||
for (j = 0; j < w; j++) {
|
||||
color = *srcPtr;
|
||||
#ifdef ENABLE_16BIT
|
||||
if (bitDepth == 16) {
|
||||
if (_cursorBitDepth == 16) {
|
||||
if (color != _mouseKeyColor) { // transparent, don't draw
|
||||
int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3;
|
||||
int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3;
|
||||
|
@ -124,11 +124,7 @@ public:
|
||||
// Disables or enables cursor palette
|
||||
void disableCursorPalette(bool disable) {
|
||||
_cursorPaletteDisabled = disable;
|
||||
#ifdef ENABLE_16BIT
|
||||
blitCursor(_cursorBitDepth);
|
||||
#else
|
||||
blitCursor();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Shaking is used in SCUMM. Set current shake position.
|
||||
@ -420,11 +416,7 @@ protected:
|
||||
|
||||
virtual void drawMouse(); // overloaded by CE backend
|
||||
virtual void undrawMouse(); // overloaded by CE backend (FIXME)
|
||||
#ifdef ENABLE_16BIT
|
||||
virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME)
|
||||
#else
|
||||
virtual void blitCursor(); // overloaded by CE backend (FIXME)
|
||||
#endif
|
||||
|
||||
/** Set the position of the virtual mouse cursor. */
|
||||
void setMousePos(int x, int y);
|
||||
|
Loading…
Reference in New Issue
Block a user