From 5d0f38d747e7583d0ca5959cd642468ba67cd04c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 17 Nov 2015 23:17:48 +0100 Subject: GRAPHICS: Fix rendering in some corner cases --- graphics/transparent_surface.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'graphics') diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp index f6e8cacb8b..992a5dc879 100644 --- a/graphics/transparent_surface.cpp +++ b/graphics/transparent_surface.cpp @@ -41,8 +41,6 @@ namespace Graphics { -static const int kAShift = 0;//img->format.aShift; - static const int kBModShift = 0;//img->format.bShift; static const int kGModShift = 8;//img->format.gShift; static const int kRModShift = 16;//img->format.rShift; @@ -118,7 +116,7 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32 in = ino; for (uint32 j = 0; j < width; j++) { uint32 pix = *(uint32 *)in; - int a = (pix >> kAShift) & 0xff; + int a = (pix >> kAModShift) & 0xff; if (a != 0) { // Full opacity (Any value not exactly 0 is Opaque here) *(uint32 *)out = pix; @@ -338,7 +336,7 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p retSize.setWidth(0); retSize.setHeight(0); // Check if we need to draw anything at all - int ca = (color >> 24) & 0xff; + int ca = (color >> kAModShift) & 0xff; if (ca == 0) { return retSize; -- cgit v1.2.3