Converted OSystem::SetMouseCursor to take pointer to PixelFormat, instead of full PixelFormat. Removed OSystem::setCursorFormat (since I forgot to do so several commits ago)
svn-id: r41901
This commit is contained in:
parent
2859c91304
commit
27e50db5d7
4 changed files with 12 additions and 25 deletions
|
@ -1162,15 +1162,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
}
|
||||
|
||||
_cursorPaletteDisabled = false;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
}
|
||||
|
||||
void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) {
|
||||
assert(format.bytesPerPixel);
|
||||
_cursorFormat = format;
|
||||
|
||||
#endif
|
||||
// blitCursor();
|
||||
blitCursor();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1378,10 +1370,12 @@ void OSystem_SDL::warpMouse(int x, int y) {
|
|||
}
|
||||
}
|
||||
|
||||
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format) {
|
||||
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format) {
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
if (format.bytesPerPixel <= _screenFormat.bytesPerPixel)
|
||||
_cursorFormat = format;
|
||||
if (!format)
|
||||
format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0);
|
||||
if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
|
||||
_cursorFormat = *format;
|
||||
keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
|
||||
#else
|
||||
keycolor &= 0xFF;
|
||||
|
|
|
@ -152,10 +152,7 @@ public:
|
|||
virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)
|
||||
|
||||
// Set the bitmap that's used when drawing the cursor.
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME)
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
virtual void setCursorFormat(Graphics::PixelFormat format);
|
||||
#endif
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME)
|
||||
|
||||
// Set colors of cursor palette
|
||||
void setCursorPalette(const byte *colors, uint start, uint num);
|
||||
|
|
|
@ -732,13 +732,9 @@ public:
|
|||
* @param hotspotY vertical offset from the top side to the hotspot
|
||||
* @param keycolor transparency color index
|
||||
* @param cursorTargetScale scale factor which cursor is designed for
|
||||
* @param format pixel format which cursor graphic uses
|
||||
* @param format pointer to the pixel format which cursor graphic uses
|
||||
*/
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
virtual void setCursorFormat(Graphics::PixelFormat format) = 0;
|
||||
#endif
|
||||
|
||||
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat *format = NULL) = 0;
|
||||
|
||||
/**
|
||||
* Replace the specified range of cursor the palette with new colors.
|
||||
|
|
|
@ -64,7 +64,7 @@ void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, in
|
|||
_cursorStack.push(cur);
|
||||
|
||||
if (buf) {
|
||||
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
|
||||
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ void CursorManager::popCursor() {
|
|||
|
||||
if (!_cursorStack.empty()) {
|
||||
cur = _cursorStack.top();
|
||||
g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format);
|
||||
g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, &(cur->_format));
|
||||
}
|
||||
|
||||
g_system->showMouse(isVisible());
|
||||
|
@ -137,7 +137,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
|
|||
cur->_format = *format;
|
||||
#endif
|
||||
|
||||
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format);
|
||||
g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);
|
||||
}
|
||||
|
||||
void CursorManager::disableCursorPalette(bool disable) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue