Some simplification of previous commit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c
index 5232125..8c50318 100644
--- a/src/video/SDL_blit_N.c
+++ b/src/video/SDL_blit_N.c
@@ -2229,7 +2229,7 @@ BlitNtoN(SDL_BlitInfo * info)
int dstbpp = dstfmt->BytesPerPixel;
unsigned alpha = dstfmt->Amask ? info->a : 0;
- /* Any src/dst 8888, no ARGB2101010 */
+ /* Any src/dst 8888, not CopyAlpha, no ARGB2101010 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
@@ -2297,7 +2297,7 @@ BlitNtoNCopyAlpha(SDL_BlitInfo * info)
int dstbpp = dstfmt->BytesPerPixel;
int c;
- /* Any src/dst 8888, no ARGB2101010 */
+ /* Any src/dst 8888 for CopyAlpha, no ARGB2101010 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
@@ -2521,52 +2521,27 @@ BlitNtoNKey(SDL_BlitInfo * info)
int missing = 0, r, g, b, a;
get_permutation(srcfmt, dstfmt, &r, &g, &b, &a, &missing);
- if (dstfmt->Amask) {
- while (height--) {
- /* *INDENT-OFF* */
- DUFFS_LOOP(
- {
- if ((*src32 & rgbmask) != ckey) {
- Uint8 *s8 = (Uint8 *)src32;
- Uint8 *d8 = (Uint8 *)dst32;
- d8[0] = s8[r];
- d8[1] = s8[g];
- d8[2] = s8[b];
- d8[3] = s8[a];
- d8[missing] = alpha;
- }
- ++src32;
- ++dst32;
- }, width);
- /* *INDENT-ON* */
- src32 = (Uint32 *)((Uint8 *)src32 + srcskip);
- dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip);
- }
-
- return;
- } else {
- while (height--) {
- /* *INDENT-OFF* */
- DUFFS_LOOP(
- {
- if ((*src32 & rgbmask) != ckey) {
- Uint8 *s8 = (Uint8 *)src32;
- Uint8 *d8 = (Uint8 *)dst32;
- d8[0] = s8[r];
- d8[1] = s8[g];
- d8[2] = s8[b];
- d8[3] = s8[a];
- d8[missing] = 0;
- }
- ++src32;
- ++dst32;
- }, width);
- /* *INDENT-ON* */
- src32 = (Uint32 *)((Uint8 *)src32 + srcskip);
- dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip);
- }
- return;
+ while (height--) {
+ /* *INDENT-OFF* */
+ DUFFS_LOOP(
+ {
+ if ((*src32 & rgbmask) != ckey) {
+ Uint8 *s8 = (Uint8 *)src32;
+ Uint8 *d8 = (Uint8 *)dst32;
+ d8[0] = s8[r];
+ d8[1] = s8[g];
+ d8[2] = s8[b];
+ d8[3] = s8[a];
+ d8[missing] = alpha;
+ }
+ ++src32;
+ ++dst32;
+ }, width);
+ /* *INDENT-ON* */
+ src32 = (Uint32 *)((Uint8 *)src32 + srcskip);
+ dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip);
}
+ return;
}
/* BPP 3, same rgb triplet */