mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
GUI: Fix black rectangle around cursor in modern remastered them without RGB
Modern remastered uses cursor with alpha. It's not correctly converted and so we get black rectangle around it when using --disable-16bit
This commit is contained in:
parent
d3f87c97ee
commit
ef3eda01e0
@ -1596,7 +1596,8 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
|
||||
memset(_cursor, 0xFF, sizeof(byte) * _cursorWidth * _cursorHeight);
|
||||
|
||||
// the transparent color is 0xFF00FF
|
||||
const uint32 colTransparent = _overlayFormat.RGBToColor(0xFF, 0, 0xFF);
|
||||
const uint32 colTransparent = cursor->format.RGBToColor(0xFF, 0, 0xFF);
|
||||
const uint32 alphaMask = cursor->format.ARGBToColor(0x80, 0, 0, 0);
|
||||
|
||||
// Now, scan the bitmap. We have to convert it from 16 bit color mode
|
||||
// to 8 bit mode, and have to create a suitable palette on the fly.
|
||||
@ -1617,7 +1618,9 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int
|
||||
src += cursor->format.bytesPerPixel;
|
||||
|
||||
// Skip transparency
|
||||
if (color == colTransparent)
|
||||
if (color == colTransparent
|
||||
// Replace with transparent is alpha is present and < 50%
|
||||
|| (alphaMask != 0 && (color & alphaMask) == 0))
|
||||
continue;
|
||||
|
||||
cursor->format.colorToRGB(color, r, g, b);
|
||||
|
Loading…
Reference in New Issue
Block a user