From 74ff79e90bb2862e8c84867ff50f56675c1b4c7e Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sat, 2 Jun 2012 14:28:58 +0200 Subject: WINTERMUTE: Implement IsTransparentAtLite, to fix the BitmapFont-drawing. --- engines/wintermute/Base/BSurfaceSDL.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp index 0b16f3d39b..af41231968 100644 --- a/engines/wintermute/Base/BSurfaceSDL.cpp +++ b/engines/wintermute/Base/BSurfaceSDL.cpp @@ -361,6 +361,16 @@ bool CBSurfaceSDL::IsTransparentAtLite(int X, int Y) { warning("CBSurfaceSDL::IsTransparentAtLite not ported yet"); hasWarned = true; } + if (_surface->format.bytesPerPixel == 4) { + uint32 pixel = *(uint32*)_surface->getBasePtr(X, Y); + uint8 r,g,b,a; + _surface->format.colorToARGB(pixel, a, r, g, b); + if (a <= 128) { + return true; + } else { + return false; + } + } #if 0 uint32 format; int access; -- cgit v1.2.3