mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
GUI: Fix display of virtual keyboard for OpenGL/OpenGLES
This commit is contained in:
parent
d7500078ff
commit
237211a7fe
@ -106,8 +106,17 @@ VirtualKeyboardGUI::~VirtualKeyboardGUI() {
|
||||
void VirtualKeyboardGUI::initMode(VirtualKeyboard::Mode *mode) {
|
||||
assert(mode->image);
|
||||
|
||||
_kbdSurface = mode->image;
|
||||
_kbdTransparentColor = mode->transparentColor;
|
||||
Graphics::PixelFormat kbdFormat = mode->image->format;
|
||||
Graphics::PixelFormat overlayFormat = _system->getOverlayFormat();
|
||||
if (kbdFormat.bytesPerPixel == overlayFormat.bytesPerPixel) {
|
||||
_kbdSurface = mode->image;
|
||||
_kbdTransparentColor = mode->transparentColor;
|
||||
} else {
|
||||
_kbdSurface = mode->image->convertTo(overlayFormat);
|
||||
byte a, r, g, b;
|
||||
kbdFormat.colorToARGB(mode->transparentColor, a, r, g, b);
|
||||
_kbdTransparentColor = overlayFormat.ARGBToColor(a, r, g, b);
|
||||
}
|
||||
_kbdBound.setWidth(_kbdSurface->w);
|
||||
_kbdBound.setHeight(_kbdSurface->h);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user