src/video/SDL_blit.h
changeset 5423 b69fa50e80d7
parent 5389 24903690f48a
child 5426 7a3982c50af8
     1.1 --- a/src/video/SDL_blit.h	Sat Mar 05 10:03:57 2011 -0800
     1.2 +++ b/src/video/SDL_blit.h	Sun Mar 06 21:12:19 2011 -0800
     1.3 @@ -114,6 +114,16 @@
     1.4  #define DECLARE_ALIGNED(t,v,a)  t v
     1.5  #endif
     1.6  
     1.7 +/* The Nintendo surfaces are special. Bit 15 is the transparency
     1.8 + * bit. It must be set for the pixel to be displayed. By setting that
     1.9 + * value to 0 for other platforms, their compiler should optimize it
    1.10 + * out. */
    1.11 +#ifdef __NDS__
    1.12 +#define NDS_BIT15 0x8000
    1.13 +#else
    1.14 +#define NDS_BIT15 0
    1.15 +#endif
    1.16 +
    1.17  /* Load pixel of the specified format from a buffer and get its R-G-B values */
    1.18  /* FIXME: rescale values to 0..255 here? */
    1.19  #define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)				\
    1.20 @@ -241,7 +251,7 @@
    1.21  			Uint16 Pixel;					\
    1.22  									\
    1.23  			PIXEL_FROM_RGB(Pixel, fmt, r, g, b);		\
    1.24 -			*((Uint16 *)(buf)) = Pixel;			\
    1.25 +			*((Uint16 *)(buf)) = Pixel | NDS_BIT15;		\
    1.26  		}							\
    1.27  		break;							\
    1.28  									\
    1.29 @@ -396,7 +406,7 @@
    1.30  			Uint16 Pixel;					\
    1.31  									\
    1.32  			PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a);	\
    1.33 -			*((Uint16 *)(buf)) = Pixel;			\
    1.34 +			*((Uint16 *)(buf)) = Pixel | NDS_BIT15;		\
    1.35  		}							\
    1.36  		break;							\
    1.37  									\