mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 22:05:05 +00:00
Simplify SDL_BLENDMODE_MUL
This commit is contained in:
parent
bd70ce7f94
commit
7d26ba754a
|
@ -52,7 +52,7 @@ typedef enum
|
||||||
dstA = dstA */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
||||||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
||||||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
||||||
|
|
||||||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \
|
#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \
|
||||||
do { \
|
do { \
|
||||||
unsigned sr, sg, sb, sa; \
|
unsigned sr, sg, sb, sa; \
|
||||||
sa = 0xFF; \
|
(void)sa; \
|
||||||
getpixel; \
|
getpixel; \
|
||||||
sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); \
|
sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); \
|
||||||
if (sr > 0xff) \
|
if (sr > 0xff) \
|
||||||
|
@ -102,9 +102,6 @@
|
||||||
sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); \
|
sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); \
|
||||||
if (sb > 0xff) \
|
if (sb > 0xff) \
|
||||||
sb = 0xff; \
|
sb = 0xff; \
|
||||||
sa = DRAW_MUL(sa, a) + DRAW_MUL(inva, sa); \
|
|
||||||
if (sa > 0xff) \
|
|
||||||
sa = 0xff; \
|
|
||||||
setpixel; \
|
setpixel; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
|
@ -869,10 +869,6 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
|
||||||
if (dstB > 255) {
|
if (dstB > 255) {
|
||||||
dstB = 255;
|
dstB = 255;
|
||||||
}
|
}
|
||||||
dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255;
|
|
||||||
if (dstA > 255) {
|
|
||||||
dstA = 255;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||||
|
|
|
@ -178,10 +178,6 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
|
||||||
if (dstB > 255) {
|
if (dstB > 255) {
|
||||||
dstB = 255;
|
dstB = 255;
|
||||||
}
|
}
|
||||||
dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255;
|
|
||||||
if (dstA > 255) {
|
|
||||||
dstA = 255;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||||
|
|
Loading…
Reference in a new issue