From 473051f6bbc89872b1e810baece231ec87bd6220 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 13:40:01 -0700 Subject: [PATCH] Fixed bug 3159 - SDL_blit_slow with BLENDING does not work Fritzor Source Suface is ABGR and Destination Surface is ABGR. We use software blending. In the Switch-Case statement for SDL_COPY_BLEND (Line 126) the alpha-channel is not calculated like in every SDL_blit_auto - function. So if the destination Surface has alpha - channel of zero the resulting surface has zero as well. Add: ?dstA = srcA + ((255 - srcA) * dstA) / 255;? to code and everything is okay. --- src/video/SDL_blit_slow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index 30db4e43b..02ab41de7 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -129,6 +129,7 @@ SDL_Blit_Slow(SDL_BlitInfo * info) dstR = srcR + ((255 - srcA) * dstR) / 255; dstG = srcG + ((255 - srcA) * dstG) / 255; dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; break; case SDL_COPY_ADD: dstR = srcR + dstR;