[Scummvm-git-logs] scummvm master -> 237211a7fec89c80e113e235ac8699b933448fa0
sev-
sev at scummvm.org
Mon Oct 19 14:40:40 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
237211a7fe GUI: Fix display of virtual keyboard for OpenGL/OpenGLES
Commit: 237211a7fec89c80e113e235ac8699b933448fa0
https://github.com/scummvm/scummvm/commit/237211a7fec89c80e113e235ac8699b933448fa0
Author: Laurent Merckx (laurent-merckx at skynet.be)
Date: 2020-10-19T16:40:36+02:00
Commit Message:
GUI: Fix display of virtual keyboard for OpenGL/OpenGLES
Changed paths:
backends/vkeybd/virtual-keyboard-gui.cpp
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index 1d2b8285f5..3759d40e7e 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -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);
More information about the Scummvm-git-logs
mailing list