src/video/SDL_blit.h
branchSDL-1.2
changeset 3976 8582c6a5ca16
parent 1402 d910939febfa
child 4159 a1b03ba2fcd0
     1.1 --- a/src/video/SDL_blit.h	Sun Jun 24 18:26:35 2007 +0000
     1.2 +++ b/src/video/SDL_blit.h	Mon Jun 25 00:50:20 2007 +0000
     1.3 @@ -166,12 +166,21 @@
     1.4  } while(0)
     1.5  
     1.6  /* Assemble R-G-B values into a specified pixel format and store them */
     1.7 +#ifdef __NDS__ // FIXME
     1.8 +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)				\
     1.9 +{									\
    1.10 +	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
    1.11 +		((g>>fmt->Gloss)<<fmt->Gshift)|				\
    1.12 +		((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15);				\
    1.13 +}
    1.14 +#else
    1.15  #define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)				\
    1.16  {									\
    1.17  	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
    1.18  		((g>>fmt->Gloss)<<fmt->Gshift)|				\
    1.19  		((b>>fmt->Bloss)<<fmt->Bshift);				\
    1.20  }
    1.21 +#endif // __NDS__ FIXME
    1.22  #define RGB565_FROM_RGB(Pixel, r, g, b)					\
    1.23  {									\
    1.24  	Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3);			\
    1.25 @@ -321,6 +330,15 @@
    1.26  } while(0)
    1.27  
    1.28  /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
    1.29 +#ifdef __NDS__ // FIXME
    1.30 +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)				\
    1.31 +{									\
    1.32 +	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
    1.33 +		((g>>fmt->Gloss)<<fmt->Gshift)|				\
    1.34 +		((b>>fmt->Bloss)<<fmt->Bshift)|				\
    1.35 +		((a>>fmt->Aloss)<<fmt->Ashift) | (1<<15);				\
    1.36 +}
    1.37 +#else
    1.38  #define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)				\
    1.39  {									\
    1.40  	Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|				\
    1.41 @@ -328,6 +346,7 @@
    1.42  		((b>>fmt->Bloss)<<fmt->Bshift)|				\
    1.43  		((a>>fmt->Aloss)<<fmt->Ashift);				\
    1.44  }
    1.45 +#endif // __NDS__ FIXME
    1.46  #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)			\
    1.47  {									\
    1.48  	switch (bpp) {							\