Made the RLE code (semi) readable again

This commit is contained in:
Sam Lantinga 2014-06-25 01:35:17 -07:00
parent b4deeeba05
commit a8955f2640
1 changed files with 253 additions and 250 deletions

View File

@ -324,9 +324,9 @@
if (fmt->Gmask == 0x07e0 \ if (fmt->Gmask == 0x07e0 \
|| fmt->Rmask == 0x07e0 \ || fmt->Rmask == 0x07e0 \
|| fmt->Bmask == 0x07e0) { \ || fmt->Bmask == 0x07e0) { \
if(alpha == 128) \ if (alpha == 128) { \
blitter(2, Uint8, ALPHA_BLIT16_565_50); \ blitter(2, Uint8, ALPHA_BLIT16_565_50); \
else { \ } else { \
blitter(2, Uint8, ALPHA_BLIT16_565); \ blitter(2, Uint8, ALPHA_BLIT16_565); \
} \ } \
} else \ } else \
@ -337,14 +337,15 @@
if (fmt->Gmask == 0x03e0 \ if (fmt->Gmask == 0x03e0 \
|| fmt->Rmask == 0x03e0 \ || fmt->Rmask == 0x03e0 \
|| fmt->Bmask == 0x03e0) { \ || fmt->Bmask == 0x03e0) { \
if(alpha == 128) \ if (alpha == 128) { \
blitter(2, Uint8, ALPHA_BLIT16_555_50); \ blitter(2, Uint8, ALPHA_BLIT16_555_50); \
else { \ } else { \
blitter(2, Uint8, ALPHA_BLIT16_555); \ blitter(2, Uint8, ALPHA_BLIT16_555); \
} \ } \
break; \ break; \
} \ } else \
/* fallthrough */ \ goto general16; \
break; \
\ \
default: \ default: \
general16: \ general16: \
@ -360,10 +361,11 @@
if ((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ if ((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
&& (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
|| fmt->Bmask == 0xff00)) { \ || fmt->Bmask == 0xff00)) { \
if(alpha == 128) \ if (alpha == 128) { \
blitter(4, Uint16, ALPHA_BLIT32_888_50); \ blitter(4, Uint16, ALPHA_BLIT32_888_50); \
else \ } else { \
blitter(4, Uint16, ALPHA_BLIT32_888); \ blitter(4, Uint16, ALPHA_BLIT32_888); \
} \
} else \ } else \
blitter(4, Uint16, ALPHA_BLIT_ANY); \ blitter(4, Uint16, ALPHA_BLIT_ANY); \
break; \ break; \
@ -416,6 +418,7 @@ RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst,
ofs += run; \ ofs += run; \
} else if (!ofs) \ } else if (!ofs) \
break; \ break; \
\
if (ofs == w) { \ if (ofs == w) { \
ofs = 0; \ ofs = 0; \
dstbuf += surf_dst->pitch; \ dstbuf += surf_dst->pitch; \