src/video/SDL_blit.h
changeset 7373 5e6efd29b461
parent 7364 e21bd6987b86
child 7502 6ff02ff3cf06
     1.1 --- a/src/video/SDL_blit.h	Sun Jul 07 10:31:01 2013 -0700
     1.2 +++ b/src/video/SDL_blit.h	Sun Jul 07 12:34:21 2013 -0700
     1.3 @@ -249,6 +249,14 @@
     1.4  {                                                                       \
     1.5      Pixel = (b<<24)|(g<<16)|(r<<8)|a;                                   \
     1.6  }
     1.7 +#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)                        \
     1.8 +{                                                                       \
     1.9 +    r = r ? ((r << 2) | 0x3) : 0;                                       \
    1.10 +    g = g ? ((g << 2) | 0x3) : 0;                                       \
    1.11 +    b = b ? ((b << 2) | 0x3) : 0;                                       \
    1.12 +    a = (a * 3) / 255;                                                  \
    1.13 +    Pixel = (a<<30)|(r<<20)|(g<<10)|b;                                  \
    1.14 +}
    1.15  #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)                            \
    1.16  {                                                                       \
    1.17      switch (bpp) {                                                      \
    1.18 @@ -334,6 +342,13 @@
    1.19      b = (Pixel>>24);                                                    \
    1.20      a = (Pixel&0xFF);                                                   \
    1.21  }
    1.22 +#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)                        \
    1.23 +{                                                                       \
    1.24 +    r = ((Pixel>>22)&0xFF);                                             \
    1.25 +    g = ((Pixel>>12)&0xFF);                                             \
    1.26 +    b = ((Pixel>>2)&0xFF);                                              \
    1.27 +    a = SDL_expand_byte[6][(Pixel>>30)];                                \
    1.28 +}
    1.29  #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)                 \
    1.30  do {                                                                    \
    1.31      switch (bpp) {                                                      \