src/video/SDL_blit.h
changeset 5426 7a3982c50af8
parent 5423 b69fa50e80d7
child 5439 3a778c6c0269
     1.1 --- a/src/video/SDL_blit.h	Sun Mar 06 21:15:46 2011 -0800
     1.2 +++ b/src/video/SDL_blit.h	Sun Mar 06 21:17:09 2011 -0800
     1.3 @@ -172,7 +172,7 @@
     1.4  		break;							   \
     1.5  									   \
     1.6  		default:						   \
     1.7 -		        Pixel; /* stop gcc complaints */		   \
     1.8 +		        Pixel = 0; /* stop gcc complaints */		   \
     1.9  		break;							   \
    1.10  	}								   \
    1.11  } while (0)
    1.12 @@ -186,6 +186,7 @@
    1.13  		break;							   \
    1.14  									   \
    1.15  		case 3:	{						   \
    1.16 +            Pixel = 0;                  \
    1.17                          if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {		   \
    1.18  			        r = *((buf)+fmt->Rshift/8);		   \
    1.19  				g = *((buf)+fmt->Gshift/8);		   \
    1.20 @@ -204,7 +205,9 @@
    1.21  		break;							   \
    1.22  									   \
    1.23  		default:						   \
    1.24 -		        Pixel; /* stop gcc complaints */		   \
    1.25 +                /* stop gcc complaints */		   \
    1.26 +		        Pixel = 0;              \
    1.27 +                r = g = b = 0;          \
    1.28  		break;							   \
    1.29  	}								   \
    1.30  } while (0)
    1.31 @@ -277,43 +280,6 @@
    1.32  		break;							\
    1.33  	}								\
    1.34  }
    1.35 -#define ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask)		\
    1.36 -{									\
    1.37 -	switch (bpp) {							\
    1.38 -		case 2: {						\
    1.39 -			Uint16 *bufp;					\
    1.40 -			Uint16 Pixel;					\
    1.41 -									\
    1.42 -			bufp = (Uint16 *)buf;				\
    1.43 -			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
    1.44 -			*bufp = Pixel | (*bufp & Amask);		\
    1.45 -		}							\
    1.46 -		break;							\
    1.47 -									\
    1.48 -		case 3: {						\
    1.49 -                        if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {		\
    1.50 -			        *((buf)+fmt->Rshift/8) = r;		\
    1.51 -				*((buf)+fmt->Gshift/8) = g;		\
    1.52 -				*((buf)+fmt->Bshift/8) = b;		\
    1.53 -			} else {					\
    1.54 -			        *((buf)+2-fmt->Rshift/8) = r;		\
    1.55 -				*((buf)+2-fmt->Gshift/8) = g;		\
    1.56 -				*((buf)+2-fmt->Bshift/8) = b;		\
    1.57 -			}						\
    1.58 -		}							\
    1.59 -		break;							\
    1.60 -									\
    1.61 -		case 4: {						\
    1.62 -			Uint32 *bufp;					\
    1.63 -			Uint32 Pixel;					\
    1.64 -									\
    1.65 -			bufp = (Uint32 *)buf;				\
    1.66 -			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
    1.67 -			*bufp = Pixel | (*bufp & Amask);		\
    1.68 -		}							\
    1.69 -		break;							\
    1.70 -	}								\
    1.71 -}
    1.72  
    1.73  /* FIXME: Should we rescale alpha into 0..255 here? */
    1.74  #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)				\
    1.75 @@ -367,6 +333,7 @@
    1.76  		break;							   \
    1.77  									   \
    1.78  		case 3:	{						   \
    1.79 +            Pixel = 0; \
    1.80                          if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {		   \
    1.81  			        r = *((buf)+fmt->Rshift/8);		   \
    1.82  				g = *((buf)+fmt->Gshift/8);		   \
    1.83 @@ -386,7 +353,9 @@
    1.84  		break;							   \
    1.85  									   \
    1.86  		default:						   \
    1.87 -		        Pixel; /* stop gcc complaints */		   \
    1.88 +                /* stop gcc complaints */		   \
    1.89 +		        Pixel = 0;              \
    1.90 +                r = g = b = a = 0;      \
    1.91  		break;							   \
    1.92  	}								   \
    1.93  } while (0)