Simplify SDL_BLENDMODE_MUL

main
Sylvain 2023-03-15 21:21:57 +01:00 committed by Sylvain Becker
parent ad1a216d65
commit 99668c286b
4 changed files with 2 additions and 13 deletions

View File

@ -52,7 +52,7 @@ typedef enum
dstA = dstA */
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
dstA = dstA */
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */

View File

@ -91,7 +91,7 @@
#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \
do { \
unsigned sr, sg, sb, sa; \
sa = 0xFF; \
(void)sa; \
getpixel; \
sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); \
if (sr > 0xff) \
@ -102,9 +102,6 @@
sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); \
if (sb > 0xff) \
sb = 0xff; \
sa = DRAW_MUL(sa, a) + DRAW_MUL(inva, sa); \
if (sa > 0xff) \
sa = 0xff; \
setpixel; \
} while (0)

View File

@ -868,10 +868,6 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
if (dstB > 255) {
dstB = 255;
}
dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255;
if (dstA > 255) {
dstA = 255;
}
break;
}
if (FORMAT_HAS_ALPHA(dstfmt_val)) {

View File

@ -177,10 +177,6 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
if (dstB > 255) {
dstB = 255;
}
dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255;
if (dstA > 255) {
dstA = 255;
}
break;
}
if (FORMAT_HAS_ALPHA(dstfmt_val)) {