*** empty log message ***
authorSam Lantinga <slouken@libsdl.org>
Thu, 29 May 2003 04:29:13 +0000
changeset 628e561e8752d33
parent 627 8b9ac38381d0
child 629 3fa401bb4bb5
*** empty log message ***
src/video/SDL_pixels.c
     1.1 --- a/src/video/SDL_pixels.c	Thu May 29 04:25:29 2003 +0000
     1.2 +++ b/src/video/SDL_pixels.c	Thu May 29 04:29:13 2003 +0000
     1.3 @@ -379,16 +379,16 @@
     1.4  		 * This only works for RGB bit fields at least 4 bit
     1.5  		 * wide, which is almost always the case.
     1.6  		 */
     1.7 -	        unsigned rv, gv, bv, av;
     1.8 -		rv = (pixel & fmt->Rmask) >> fmt->Rshift;
     1.9 -		*r = (rv << fmt->Rloss) + (rv >> (8 - fmt->Rloss));
    1.10 -		gv = (pixel & fmt->Gmask) >> fmt->Gshift;
    1.11 -		*g = (gv << fmt->Gloss) + (gv >> (8 - fmt->Gloss));
    1.12 -		bv = (pixel & fmt->Bmask) >> fmt->Bshift;
    1.13 -		*b = (bv << fmt->Bloss) + (bv >> (8 - fmt->Bloss));
    1.14 +	        unsigned v;
    1.15 +		v = (pixel & fmt->Rmask) >> fmt->Rshift;
    1.16 +		*r = (v << fmt->Rloss) + (v >> (8 - fmt->Rloss));
    1.17 +		v = (pixel & fmt->Gmask) >> fmt->Gshift;
    1.18 +		*g = (v << fmt->Gloss) + (v >> (8 - fmt->Gloss));
    1.19 +		v = (pixel & fmt->Bmask) >> fmt->Bshift;
    1.20 +		*b = (v << fmt->Bloss) + (v >> (8 - fmt->Bloss));
    1.21  		if(fmt->Amask) {
    1.22 -		        av = (pixel & fmt->Amask) >> fmt->Ashift;
    1.23 -			*a = (av << fmt->Aloss) + (av >> (8 - fmt->Aloss));
    1.24 +		        v = (pixel & fmt->Amask) >> fmt->Ashift;
    1.25 +			*a = (v << fmt->Aloss) + (v >> (8 - fmt->Aloss));
    1.26  		} else
    1.27  		        *a = SDL_ALPHA_OPAQUE;
    1.28  	} else {
    1.29 @@ -403,13 +403,13 @@
    1.30  {
    1.31  	if ( fmt->palette == NULL ) {
    1.32  	        /* the note for SDL_GetRGBA above applies here too */
    1.33 -	        unsigned rv, gv, bv;
    1.34 -		rv = (pixel & fmt->Rmask) >> fmt->Rshift;
    1.35 -		*r = (rv << fmt->Rloss) + (rv >> (8 - fmt->Rloss));
    1.36 -		gv = (pixel & fmt->Gmask) >> fmt->Gshift;
    1.37 -		*g = (gv << fmt->Gloss) + (gv >> (8 - fmt->Gloss));
    1.38 -		bv = (pixel & fmt->Bmask) >> fmt->Bshift;
    1.39 -		*b = (bv << fmt->Bloss) + (bv >> (8 - fmt->Bloss));
    1.40 +	        unsigned v;
    1.41 +		v = (pixel & fmt->Rmask) >> fmt->Rshift;
    1.42 +		*r = (v << fmt->Rloss) + (v >> (8 - fmt->Rloss));
    1.43 +		v = (pixel & fmt->Gmask) >> fmt->Gshift;
    1.44 +		*g = (v << fmt->Gloss) + (v >> (8 - fmt->Gloss));
    1.45 +		v = (pixel & fmt->Bmask) >> fmt->Bshift;
    1.46 +		*b = (v << fmt->Bloss) + (v >> (8 - fmt->Bloss));
    1.47  	} else {
    1.48  		*r = fmt->palette->colors[pixel].r;
    1.49  		*g = fmt->palette->colors[pixel].g;