FunKey-OS/FunKey/board/funkey/patches/0001-pixel-alpha-multiply.p...

24 lines
781 B
Diff

SDL_blit_A.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c
index 219cdcc..d8e921e 100644
--- a/src/video/SDL_blit_A.c
+++ b/src/video/SDL_blit_A.c
@@ -2679,6 +2985,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
int dstskip = info->d_skip;
SDL_PixelFormat *srcfmt = info->src;
SDL_PixelFormat *dstfmt = info->dst;
+ uint8_t alpha_multiply = srcfmt->alpha;
int srcbpp;
int dstbpp;
@@ -2705,6 +3012,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
unsigned sA;
unsigned dA;
DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
+ sA=(sA*alpha_multiply)>>8;
if(sA) {
DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB);