src/video/SDL_blit_1.c
changeset 7502 6ff02ff3cf06
parent 6967 adc80d085ddf
child 8093 b43765095a6f
     1.1 --- a/src/video/SDL_blit_1.c	Mon Jul 22 02:51:45 2013 -0700
     1.2 +++ b/src/video/SDL_blit_1.c	Tue Jul 23 08:06:49 2013 -0700
     1.3 @@ -437,30 +437,29 @@
     1.4      SDL_PixelFormat *dstfmt = info->dst_fmt;
     1.5      const SDL_Color *srcpal = info->src_fmt->palette->colors;
     1.6      int dstbpp;
     1.7 -    const int A = info->a;
     1.8 +    Uint32 pixel;
     1.9 +    unsigned sR, sG, sB;
    1.10 +    unsigned dR, dG, dB, dA;
    1.11 +    const unsigned A = info->a;
    1.12  
    1.13      /* Set up some basic variables */
    1.14      dstbpp = dstfmt->BytesPerPixel;
    1.15  
    1.16      while (height--) {
    1.17 -        int sR, sG, sB;
    1.18 -        int dR, dG, dB;
    1.19 -	    	/* *INDENT-OFF* */
    1.20 -	    	DUFFS_LOOP4(
    1.21 -			{
    1.22 -			        Uint32 pixel;
    1.23 -				sR = srcpal[*src].r;
    1.24 -				sG = srcpal[*src].g;
    1.25 -				sB = srcpal[*src].b;
    1.26 -				DISEMBLE_RGB(dst, dstbpp, dstfmt,
    1.27 -					     pixel, dR, dG, dB);
    1.28 -				ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
    1.29 -			  	ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
    1.30 -				src++;
    1.31 -				dst += dstbpp;
    1.32 -			},
    1.33 -			width);
    1.34 -	    	/* *INDENT-ON* */
    1.35 +        /* *INDENT-OFF* */
    1.36 +        DUFFS_LOOP4(
    1.37 +        {
    1.38 +            sR = srcpal[*src].r;
    1.39 +            sG = srcpal[*src].g;
    1.40 +            sB = srcpal[*src].b;
    1.41 +            DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
    1.42 +            ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
    1.43 +            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
    1.44 +            src++;
    1.45 +            dst += dstbpp;
    1.46 +        },
    1.47 +        width);
    1.48 +        /* *INDENT-ON* */
    1.49          src += srcskip;
    1.50          dst += dstskip;
    1.51      }
    1.52 @@ -479,26 +478,25 @@
    1.53      const SDL_Color *srcpal = info->src_fmt->palette->colors;
    1.54      Uint32 ckey = info->colorkey;
    1.55      int dstbpp;
    1.56 -    const int A = info->a;
    1.57 +    Uint32 pixel;
    1.58 +    unsigned sR, sG, sB;
    1.59 +    unsigned dR, dG, dB, dA;
    1.60 +    const unsigned A = info->a;
    1.61  
    1.62      /* Set up some basic variables */
    1.63      dstbpp = dstfmt->BytesPerPixel;
    1.64  
    1.65      while (height--) {
    1.66 -        int sR, sG, sB;
    1.67 -        int dR, dG, dB;
    1.68  		/* *INDENT-OFF* */
    1.69  		DUFFS_LOOP(
    1.70  		{
    1.71  			if ( *src != ckey ) {
    1.72 -			        Uint32 pixel;
    1.73  				sR = srcpal[*src].r;
    1.74  				sG = srcpal[*src].g;
    1.75  				sB = srcpal[*src].b;
    1.76 -				DISEMBLE_RGB(dst, dstbpp, dstfmt,
    1.77 -							pixel, dR, dG, dB);
    1.78 -				ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
    1.79 -			  	ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
    1.80 +				DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
    1.81 +				ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
    1.82 +			  	ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
    1.83  			}
    1.84  			src++;
    1.85  			dst += dstbpp;