src/video/SDL_blit.h
changeset 3054 8d93bfecb9dc
parent 3035 ff602fdfdedc
child 3363 90aec03bf9fd
     1.1 --- a/src/video/SDL_blit.h	Fri Jan 30 06:40:16 2009 +0000
     1.2 +++ b/src/video/SDL_blit.h	Sat Feb 07 17:56:08 2009 +0000
     1.3 @@ -240,6 +240,18 @@
     1.4  {									\
     1.5  	Pixel = (a<<24)|(r<<16)|(g<<8)|b;				\
     1.6  }
     1.7 +#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a)				\
     1.8 +{									\
     1.9 +	Pixel = (r<<24)|(g<<16)|(b<<8)|a;				\
    1.10 +}
    1.11 +#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a)				\
    1.12 +{									\
    1.13 +	Pixel = (a<<24)|(b<<16)|(g<<8)|r;				\
    1.14 +}
    1.15 +#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)				\
    1.16 +{									\
    1.17 +	Pixel = (b<<24)|(g<<16)|(r<<8)|a;				\
    1.18 +}
    1.19  #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) 				\
    1.20  {									\
    1.21  	switch (bpp) {							\
    1.22 @@ -347,6 +359,13 @@
    1.23  	b = ((Pixel>>16)&0xFF);						\
    1.24  	a = (Pixel>>24);						\
    1.25  }
    1.26 +#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a)				\
    1.27 +{									\
    1.28 +	r = ((Pixel>>8)&0xFF);						\
    1.29 +	g = ((Pixel>>16)&0xFF);						\
    1.30 +	b = (Pixel>>24);						\
    1.31 +	a = (Pixel&0xFF);						\
    1.32 +}
    1.33  #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)			   \
    1.34  do {									   \
    1.35  	switch (bpp) {							   \