Mercurial > sdl-ios-xcode
diff src/video/SDL_blit.h @ 3976:8582c6a5ca16 SDL-1.2
Added initial support for Nintendo DS, based on the work by Troy Davis (GPF)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 25 Jun 2007 00:50:20 +0000 |
parents | d910939febfa |
children | a1b03ba2fcd0 |
line wrap: on
line diff
--- a/src/video/SDL_blit.h Sun Jun 24 18:26:35 2007 +0000 +++ b/src/video/SDL_blit.h Mon Jun 25 00:50:20 2007 +0000 @@ -166,12 +166,21 @@ } while(0) /* Assemble R-G-B values into a specified pixel format and store them */ +#ifdef __NDS__ // FIXME +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ +{ \ + Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ + ((g>>fmt->Gloss)<<fmt->Gshift)| \ + ((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15); \ +} +#else #define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ { \ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ ((g>>fmt->Gloss)<<fmt->Gshift)| \ ((b>>fmt->Bloss)<<fmt->Bshift); \ } +#endif // __NDS__ FIXME #define RGB565_FROM_RGB(Pixel, r, g, b) \ { \ Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ @@ -321,6 +330,15 @@ } while(0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ +#ifdef __NDS__ // FIXME +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ +{ \ + Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ + ((g>>fmt->Gloss)<<fmt->Gshift)| \ + ((b>>fmt->Bloss)<<fmt->Bshift)| \ + ((a>>fmt->Aloss)<<fmt->Ashift) | (1<<15); \ +} +#else #define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ { \ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \ @@ -328,6 +346,7 @@ ((b>>fmt->Bloss)<<fmt->Bshift)| \ ((a>>fmt->Aloss)<<fmt->Ashift); \ } +#endif // __NDS__ FIXME #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ { \ switch (bpp) { \