src/video/SDL_blit_N.c
changeset 1162 2651158f59b8
parent 1139 d0ae4dff7208
child 1175 867f521591e5
     1.1 --- a/src/video/SDL_blit_N.c	Thu Oct 20 06:53:56 2005 +0000
     1.2 +++ b/src/video/SDL_blit_N.c	Thu Oct 20 06:55:26 2005 +0000
     1.3 @@ -36,10 +36,11 @@
     1.4  /* Functions to blit from N-bit surfaces to other surfaces */
     1.5  
     1.6  #ifdef USE_ALTIVEC_BLITTERS
     1.7 +#include <altivec.h>
     1.8  #include <assert.h>
     1.9 +#include <stdlib.h>
    1.10  #ifdef MACOSX
    1.11  #include <sys/sysctl.h>
    1.12 -#include <stdlib.h>
    1.13  static size_t GetL3CacheSize( void )
    1.14  {
    1.15      const char key[] = "hw.l3cachesize";
    1.16 @@ -60,6 +61,18 @@
    1.17  }
    1.18  #endif /* MACOSX */
    1.19  
    1.20 +#if ((defined MACOSX) && (__GNUC__ < 4))
    1.21 +    #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.22 +        (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
    1.23 +    #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.24 +        (vector unsigned short) ( a,b,c,d,e,f,g,h )
    1.25 +#else
    1.26 +    #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.27 +        (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
    1.28 +    #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.29 +        (vector unsigned short) { a,b,c,d,e,f,g,h }
    1.30 +#endif
    1.31 +
    1.32  #define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F)
    1.33  #define VSWIZZLE32(a,b,c,d) (vector unsigned char) \
    1.34                                 ( 0x00+a, 0x00+b, 0x00+c, 0x00+d, \
    1.35 @@ -112,7 +125,8 @@
    1.36      if (!dstfmt) {
    1.37          dstfmt = &default_pixel_format;
    1.38      }
    1.39 -    vector unsigned char plus = (vector unsigned char)( 0x00, 0x00, 0x00, 0x00,
    1.40 +    vector unsigned char plus = VECUINT8_LITERAL(
    1.41 +                                      0x00, 0x00, 0x00, 0x00,
    1.42                                        0x04, 0x04, 0x04, 0x04,
    1.43                                        0x08, 0x08, 0x08, 0x08,
    1.44                                        0x0C, 0x0C, 0x0C, 0x0C );
    1.45 @@ -130,7 +144,7 @@
    1.46          amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
    1.47      }           
    1.48  #undef RESHIFT  
    1.49 -    ((unsigned int *)&srcvec)[0] = (rmask | gmask | bmask | amask);
    1.50 +    ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
    1.51      vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
    1.52      return(vswiz);
    1.53  }
    1.54 @@ -145,17 +159,17 @@
    1.55      SDL_PixelFormat *srcfmt = info->src;
    1.56      vector unsigned char valpha = vec_splat_u8(0);
    1.57      vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
    1.58 -    vector unsigned char vgmerge = (vector unsigned char)(
    1.59 +    vector unsigned char vgmerge = VECUINT8_LITERAL(
    1.60          0x00, 0x02, 0x00, 0x06,
    1.61          0x00, 0x0a, 0x00, 0x0e,
    1.62          0x00, 0x12, 0x00, 0x16,
    1.63          0x00, 0x1a, 0x00, 0x1e);
    1.64      vector unsigned short v1 = vec_splat_u16(1);
    1.65      vector unsigned short v3 = vec_splat_u16(3);
    1.66 -    vector unsigned short v3f = (vector unsigned short)(
    1.67 +    vector unsigned short v3f = VECUINT16_LITERAL(
    1.68          0x003f, 0x003f, 0x003f, 0x003f,
    1.69          0x003f, 0x003f, 0x003f, 0x003f);
    1.70 -    vector unsigned short vfc = (vector unsigned short)(
    1.71 +    vector unsigned short vfc = VECUINT16_LITERAL(
    1.72          0x00fc, 0x00fc, 0x00fc, 0x00fc,
    1.73          0x00fc, 0x00fc, 0x00fc, 0x00fc);
    1.74      vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
    1.75 @@ -172,9 +186,9 @@
    1.76          /* do scalar until we can align... */
    1.77  #define ONE_PIXEL_BLEND(condition, widthvar) \
    1.78          while (condition) { \
    1.79 -            Uint32 pixel; \
    1.80 +            Uint32 Pixel; \
    1.81              unsigned sR, sG, sB, sA; \
    1.82 -            DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, pixel, \
    1.83 +            DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \
    1.84                            sR, sG, sB, sA); \
    1.85              *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \
    1.86                                  ((sG << 3) & 0x000007E0) | \
    1.87 @@ -259,20 +273,20 @@
    1.88          0x00 - 0x0e evens are the red
    1.89          0x01 - 0x0f odds are zero
    1.90      */
    1.91 -    vector unsigned char vredalpha1 = (vector unsigned char)(
    1.92 +    vector unsigned char vredalpha1 = VECUINT8_LITERAL(
    1.93          0x10, 0x00, 0x01, 0x01,
    1.94          0x10, 0x02, 0x01, 0x01,
    1.95          0x10, 0x04, 0x01, 0x01,
    1.96          0x10, 0x06, 0x01, 0x01
    1.97      );
    1.98 -    vector unsigned char vredalpha2 = (vector unsigned char)(
    1.99 +    vector unsigned char vredalpha2 = (vector unsigned char) (
   1.100          vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
   1.101      );
   1.102      /*
   1.103          0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.104          0x11 - 0x0f odds are blue
   1.105      */
   1.106 -    vector unsigned char vblue1 = (vector unsigned char)(
   1.107 +    vector unsigned char vblue1 = VECUINT8_LITERAL(
   1.108          0x00, 0x01, 0x02, 0x11,
   1.109          0x04, 0x05, 0x06, 0x13,
   1.110          0x08, 0x09, 0x0a, 0x15,
   1.111 @@ -285,7 +299,7 @@
   1.112          0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.113          0x10 - 0x0e evens are green
   1.114      */
   1.115 -    vector unsigned char vgreen1 = (vector unsigned char)(
   1.116 +    vector unsigned char vgreen1 = VECUINT8_LITERAL(
   1.117          0x00, 0x01, 0x10, 0x03,
   1.118          0x04, 0x05, 0x12, 0x07,
   1.119          0x08, 0x09, 0x14, 0x0b,
   1.120 @@ -323,10 +337,10 @@
   1.121  #define ONE_PIXEL_BLEND(condition, widthvar) \
   1.122          while (condition) { \
   1.123              unsigned sR, sG, sB; \
   1.124 -            unsigned short pixel = *((unsigned short *)src); \
   1.125 -            sR = (pixel >> 8) & 0xf8; \
   1.126 -            sG = (pixel >> 3) & 0xfc; \
   1.127 -            sB = (pixel << 3) & 0xf8; \
   1.128 +            unsigned short Pixel = *((unsigned short *)src); \
   1.129 +            sR = (Pixel >> 8) & 0xf8; \
   1.130 +            sG = (Pixel >> 3) & 0xfc; \
   1.131 +            sB = (Pixel << 3) & 0xf8; \
   1.132              ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
   1.133              src += 2; \
   1.134              dst += 4; \
   1.135 @@ -404,7 +418,7 @@
   1.136          0x00 - 0x0e evens are the red
   1.137          0x01 - 0x0f odds are zero
   1.138      */
   1.139 -    vector unsigned char vredalpha1 = (vector unsigned char)(
   1.140 +    vector unsigned char vredalpha1 = VECUINT8_LITERAL(
   1.141          0x10, 0x00, 0x01, 0x01,
   1.142          0x10, 0x02, 0x01, 0x01,
   1.143          0x10, 0x04, 0x01, 0x01,
   1.144 @@ -417,7 +431,7 @@
   1.145          0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.146          0x11 - 0x0f odds are blue
   1.147      */
   1.148 -    vector unsigned char vblue1 = (vector unsigned char)(
   1.149 +    vector unsigned char vblue1 = VECUINT8_LITERAL(
   1.150          0x00, 0x01, 0x02, 0x11,
   1.151          0x04, 0x05, 0x06, 0x13,
   1.152          0x08, 0x09, 0x0a, 0x15,
   1.153 @@ -430,7 +444,7 @@
   1.154          0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.155          0x10 - 0x0e evens are green
   1.156      */
   1.157 -    vector unsigned char vgreen1 = (vector unsigned char)(
   1.158 +    vector unsigned char vgreen1 = VECUINT8_LITERAL(
   1.159          0x00, 0x01, 0x10, 0x03,
   1.160          0x04, 0x05, 0x12, 0x07,
   1.161          0x08, 0x09, 0x14, 0x0b,
   1.162 @@ -468,10 +482,10 @@
   1.163  #define ONE_PIXEL_BLEND(condition, widthvar) \
   1.164          while (condition) { \
   1.165              unsigned sR, sG, sB; \
   1.166 -            unsigned short pixel = *((unsigned short *)src); \
   1.167 -            sR = (pixel >> 7) & 0xf8; \
   1.168 -            sG = (pixel >> 2) & 0xf8; \
   1.169 -            sB = (pixel << 3) & 0xf8; \
   1.170 +            unsigned short Pixel = *((unsigned short *)src); \
   1.171 +            sR = (Pixel >> 7) & 0xf8; \
   1.172 +            sG = (Pixel >> 2) & 0xf8; \
   1.173 +            sB = (Pixel << 3) & 0xf8; \
   1.174              ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
   1.175              src += 2; \
   1.176              dst += 4; \
   1.177 @@ -565,39 +579,39 @@
   1.178          valpha = (vector unsigned int)vzero;
   1.179      }
   1.180      ckey &= rgbmask;
   1.181 -    ((unsigned int *)&vckey)[0] = ckey;
   1.182 +    ((unsigned int *)(char*)&vckey)[0] = ckey;
   1.183      vckey = vec_splat(vckey, 0);
   1.184 -    ((unsigned int *)&vrgbmask)[0] = rgbmask;
   1.185 +    ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask;
   1.186      vrgbmask = vec_splat(vrgbmask, 0);
   1.187  
   1.188      while (height--) {
   1.189  #define ONE_PIXEL_BLEND(condition, widthvar) \
   1.190          if (copy_alpha) { \
   1.191              while (condition) { \
   1.192 -                Uint32 pixel; \
   1.193 +                Uint32 Pixel; \
   1.194                  unsigned sR, sG, sB, sA; \
   1.195 -                DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, pixel, \
   1.196 +                DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \
   1.197                            sR, sG, sB, sA); \
   1.198 -                if ( (pixel & rgbmask) != ckey ) { \
   1.199 +                if ( (Pixel & rgbmask) != ckey ) { \
   1.200                        ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
   1.201                              sR, sG, sB, sA); \
   1.202                  } \
   1.203 -                ((Uint8 *)dstp) += dstbpp; \
   1.204 -                ((Uint8 *)srcp) += srcbpp; \
   1.205 +                dstp = (Uint32 *) (((Uint8 *) dstp) + dstbpp); \
   1.206 +                srcp = (Uint32 *) (((Uint8 *) srcp) + srcbpp); \
   1.207                  widthvar--; \
   1.208              } \
   1.209          } else { \
   1.210              while (condition) { \
   1.211 -                Uint32 pixel; \
   1.212 +                Uint32 Pixel; \
   1.213                  unsigned sR, sG, sB; \
   1.214 -                RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, pixel); \
   1.215 -                if ( pixel != ckey ) { \
   1.216 -                    RGB_FROM_PIXEL(pixel, srcfmt, sR, sG, sB); \
   1.217 +                RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \
   1.218 +                if ( Pixel != ckey ) { \
   1.219 +                    RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
   1.220                      ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
   1.221                                sR, sG, sB, alpha); \
   1.222                  } \
   1.223 -                ((Uint8 *)dstp) += dstbpp; \
   1.224 -                ((Uint8 *)srcp) += srcbpp; \
   1.225 +                dstp = (Uint32 *) (((Uint8 *)dstp) + dstbpp); \
   1.226 +                srcp = (Uint32 *) (((Uint8 *)srcp) + srcbpp); \
   1.227                  widthvar--; \
   1.228              } \
   1.229          }
   1.230 @@ -819,6 +833,7 @@
   1.231                  /* Feature 2 is has-AltiVec */
   1.232                  | ((SDL_HasAltiVec()) ? 2 : 0)
   1.233                  /* Feature 4 is dont-use-prefetch */
   1.234 +                /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
   1.235                  | ((GetL3CacheSize() == 0) ? 4 : 0)
   1.236              );
   1.237          }
   1.238 @@ -911,43 +926,43 @@
   1.239  			dst += dstskip;
   1.240  		}
   1.241  	} else {
   1.242 -		int pixel;
   1.243 +		int Pixel;
   1.244  
   1.245  		while ( height-- ) {
   1.246  #ifdef USE_DUFFS_LOOP
   1.247  			DUFFS_LOOP(
   1.248 -				RGB888_RGB332(pixel, *src);
   1.249 -				*dst++ = map[pixel];
   1.250 +				RGB888_RGB332(Pixel, *src);
   1.251 +				*dst++ = map[Pixel];
   1.252  				++src;
   1.253  			, width);
   1.254  #else
   1.255  			for ( c=width/4; c; --c ) {
   1.256  				/* Pack RGB into 8bit pixel */
   1.257 -				RGB888_RGB332(pixel, *src);
   1.258 -				*dst++ = map[pixel];
   1.259 +				RGB888_RGB332(Pixel, *src);
   1.260 +				*dst++ = map[Pixel];
   1.261  				++src;
   1.262 -				RGB888_RGB332(pixel, *src);
   1.263 -				*dst++ = map[pixel];
   1.264 +				RGB888_RGB332(Pixel, *src);
   1.265 +				*dst++ = map[Pixel];
   1.266  				++src;
   1.267 -				RGB888_RGB332(pixel, *src);
   1.268 -				*dst++ = map[pixel];
   1.269 +				RGB888_RGB332(Pixel, *src);
   1.270 +				*dst++ = map[Pixel];
   1.271  				++src;
   1.272 -				RGB888_RGB332(pixel, *src);
   1.273 -				*dst++ = map[pixel];
   1.274 +				RGB888_RGB332(Pixel, *src);
   1.275 +				*dst++ = map[Pixel];
   1.276  				++src;
   1.277  			}
   1.278  			switch ( width & 3 ) {
   1.279  				case 3:
   1.280 -					RGB888_RGB332(pixel, *src);
   1.281 -					*dst++ = map[pixel];
   1.282 +					RGB888_RGB332(Pixel, *src);
   1.283 +					*dst++ = map[Pixel];
   1.284  					++src;
   1.285  				case 2:
   1.286 -					RGB888_RGB332(pixel, *src);
   1.287 -					*dst++ = map[pixel];
   1.288 +					RGB888_RGB332(Pixel, *src);
   1.289 +					*dst++ = map[Pixel];
   1.290  					++src;
   1.291  				case 1:
   1.292 -					RGB888_RGB332(pixel, *src);
   1.293 -					*dst++ = map[pixel];
   1.294 +					RGB888_RGB332(Pixel, *src);
   1.295 +					*dst++ = map[Pixel];
   1.296  					++src;
   1.297  			}
   1.298  #endif /* USE_DUFFS_LOOP */
   1.299 @@ -1820,7 +1835,7 @@
   1.300  #ifndef USE_DUFFS_LOOP
   1.301  	int c;
   1.302  #endif
   1.303 -	int pixel;
   1.304 +	int Pixel;
   1.305  	int width, height;
   1.306  	Uint32 *src;
   1.307  	const Uint8 *map;
   1.308 @@ -1839,8 +1854,8 @@
   1.309  #ifdef USE_DUFFS_LOOP
   1.310  	while ( height-- ) {
   1.311  		DUFFS_LOOP(
   1.312 -			RGB888_RGB332(pixel, *src);
   1.313 -			*dst++ = map[pixel];
   1.314 +			RGB888_RGB332(Pixel, *src);
   1.315 +			*dst++ = map[Pixel];
   1.316  			++src;
   1.317  		, width);
   1.318  		src += srcskip;
   1.319 @@ -1850,31 +1865,31 @@
   1.320  	while ( height-- ) {
   1.321  		for ( c=width/4; c; --c ) {
   1.322  			/* Pack RGB into 8bit pixel */
   1.323 -			RGB888_RGB332(pixel, *src);
   1.324 -			*dst++ = map[pixel];
   1.325 +			RGB888_RGB332(Pixel, *src);
   1.326 +			*dst++ = map[Pixel];
   1.327  			++src;
   1.328 -			RGB888_RGB332(pixel, *src);
   1.329 -			*dst++ = map[pixel];
   1.330 +			RGB888_RGB332(Pixel, *src);
   1.331 +			*dst++ = map[Pixel];
   1.332  			++src;
   1.333 -			RGB888_RGB332(pixel, *src);
   1.334 -			*dst++ = map[pixel];
   1.335 +			RGB888_RGB332(Pixel, *src);
   1.336 +			*dst++ = map[Pixel];
   1.337  			++src;
   1.338 -			RGB888_RGB332(pixel, *src);
   1.339 -			*dst++ = map[pixel];
   1.340 +			RGB888_RGB332(Pixel, *src);
   1.341 +			*dst++ = map[Pixel];
   1.342  			++src;
   1.343  		}
   1.344  		switch ( width & 3 ) {
   1.345  			case 3:
   1.346 -				RGB888_RGB332(pixel, *src);
   1.347 -				*dst++ = map[pixel];
   1.348 +				RGB888_RGB332(Pixel, *src);
   1.349 +				*dst++ = map[Pixel];
   1.350  				++src;
   1.351  			case 2:
   1.352 -				RGB888_RGB332(pixel, *src);
   1.353 -				*dst++ = map[pixel];
   1.354 +				RGB888_RGB332(Pixel, *src);
   1.355 +				*dst++ = map[Pixel];
   1.356  				++src;
   1.357  			case 1:
   1.358 -				RGB888_RGB332(pixel, *src);
   1.359 -				*dst++ = map[pixel];
   1.360 +				RGB888_RGB332(Pixel, *src);
   1.361 +				*dst++ = map[Pixel];
   1.362  				++src;
   1.363  		}
   1.364  		src += srcskip;
   1.365 @@ -1893,7 +1908,7 @@
   1.366  	Uint8 *dst;
   1.367  	int srcskip, dstskip;
   1.368  	int srcbpp;
   1.369 -	Uint32 pixel;
   1.370 +	Uint32 Pixel;
   1.371  	int  sR, sG, sB;
   1.372  	SDL_PixelFormat *srcfmt;
   1.373  
   1.374 @@ -1912,7 +1927,7 @@
   1.375  		while ( height-- ) {
   1.376  #ifdef USE_DUFFS_LOOP
   1.377  			DUFFS_LOOP(
   1.378 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.379 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.380  								sR, sG, sB);
   1.381  				if ( 1 ) {
   1.382  				  	/* Pack RGB into 8bit pixel */
   1.383 @@ -1925,7 +1940,7 @@
   1.384  			, width);
   1.385  #else
   1.386  			for ( c=width; c; --c ) {
   1.387 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.388 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.389  								sR, sG, sB);
   1.390  				if ( 1 ) {
   1.391  				  	/* Pack RGB into 8bit pixel */
   1.392 @@ -1944,7 +1959,7 @@
   1.393  		while ( height-- ) {
   1.394  #ifdef USE_DUFFS_LOOP
   1.395  			DUFFS_LOOP(
   1.396 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.397 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.398  								sR, sG, sB);
   1.399  				if ( 1 ) {
   1.400  				  	/* Pack RGB into 8bit pixel */
   1.401 @@ -1957,7 +1972,7 @@
   1.402  			, width);
   1.403  #else
   1.404  			for ( c=width; c; --c ) {
   1.405 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.406 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.407  								sR, sG, sB);
   1.408  				if ( 1 ) {
   1.409  				  	/* Pack RGB into 8bit pixel */
   1.410 @@ -1991,11 +2006,11 @@
   1.411  	while ( height-- ) {
   1.412  		DUFFS_LOOP(
   1.413  		{
   1.414 -		        Uint32 pixel;
   1.415 +		        Uint32 Pixel;
   1.416  			unsigned sR;
   1.417  			unsigned sG;
   1.418  			unsigned sB;
   1.419 -			DISEMBLE_RGB(src, srcbpp, srcfmt, pixel, sR, sG, sB);
   1.420 +			DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
   1.421  			ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
   1.422  			dst += dstbpp;
   1.423  			src += srcbpp;
   1.424 @@ -2023,9 +2038,9 @@
   1.425  	/* FIXME: should map alpha to [0..255] correctly! */
   1.426  	while ( height-- ) {
   1.427  		for ( c=width; c; --c ) {
   1.428 -		        Uint32 pixel;
   1.429 +		        Uint32 Pixel;
   1.430  			unsigned sR, sG, sB, sA;
   1.431 -			DISEMBLE_RGBA(src, srcbpp, srcfmt, pixel,
   1.432 +			DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
   1.433  				      sR, sG, sB, sA);
   1.434  			ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
   1.435  				      sR, sG, sB, sA);
   1.436 @@ -2050,7 +2065,7 @@
   1.437  	Uint32 ckey = srcfmt->colorkey;
   1.438  	Uint32 rgbmask = ~srcfmt->Amask;
   1.439  	int srcbpp;
   1.440 -	Uint32 pixel;
   1.441 +	Uint32 Pixel;
   1.442  	Uint8  sR, sG, sB;
   1.443  
   1.444  	/* Set up some basic variables */
   1.445 @@ -2061,9 +2076,9 @@
   1.446  		while ( height-- ) {
   1.447  			DUFFS_LOOP(
   1.448  			{
   1.449 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.450 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.451  								sR, sG, sB);
   1.452 -				if ( (pixel & rgbmask) != ckey ) {
   1.453 +				if ( (Pixel & rgbmask) != ckey ) {
   1.454  				  	/* Pack RGB into 8bit pixel */
   1.455  				  	*dst = ((sR>>5)<<(3+2))|
   1.456  						((sG>>5)<<(2)) |
   1.457 @@ -2080,9 +2095,9 @@
   1.458  		while ( height-- ) {
   1.459  			DUFFS_LOOP(
   1.460  			{
   1.461 -				DISEMBLE_RGB(src, srcbpp, srcfmt, pixel,
   1.462 +				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
   1.463  								sR, sG, sB);
   1.464 -				if ( (pixel & rgbmask) != ckey ) {
   1.465 +				if ( (Pixel & rgbmask) != ckey ) {
   1.466  				  	/* Pack RGB into 8bit pixel */
   1.467  				  	*dst = palmap[((sR>>5)<<(3+2))|
   1.468  							((sG>>5)<<(2))  |
   1.469 @@ -2147,13 +2162,13 @@
   1.470  	while ( height-- ) {
   1.471  		DUFFS_LOOP(
   1.472  		{
   1.473 -		        Uint32 pixel;
   1.474 +		        Uint32 Pixel;
   1.475  			unsigned sR;
   1.476  			unsigned sG;
   1.477  			unsigned sB;
   1.478 -			RETRIEVE_RGB_PIXEL(src, srcbpp, pixel);
   1.479 -			if ( pixel != ckey ) {
   1.480 -			        RGB_FROM_PIXEL(pixel, srcfmt, sR, sG, sB);
   1.481 +			RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
   1.482 +			if ( Pixel != ckey ) {
   1.483 +			        RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
   1.484  				ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
   1.485  					      sR, sG, sB, alpha);
   1.486  			}
   1.487 @@ -2181,7 +2196,7 @@
   1.488  
   1.489  	Uint8 srcbpp;
   1.490  	Uint8 dstbpp;
   1.491 -	Uint32 pixel;
   1.492 +	Uint32 Pixel;
   1.493  	Uint8  sR, sG, sB, sA;
   1.494  
   1.495  	/* Set up some basic variables */
   1.496 @@ -2193,9 +2208,9 @@
   1.497  	while ( height-- ) {
   1.498  		DUFFS_LOOP(
   1.499  		{
   1.500 -			DISEMBLE_RGBA(src, srcbpp, srcfmt, pixel,
   1.501 +			DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
   1.502  				      sR, sG, sB, sA);
   1.503 -			if ( (pixel & rgbmask) != ckey ) {
   1.504 +			if ( (Pixel & rgbmask) != ckey ) {
   1.505  				  ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
   1.506  						sR, sG, sB, sA);
   1.507  			}