diff src/video/SDL_blit.h @ 3054:8d93bfecb9dc

Fixed alpha blending textures with the GDI renderer
author Sam Lantinga <slouken@libsdl.org>
date Sat, 07 Feb 2009 17:56:08 +0000
parents ff602fdfdedc
children 90aec03bf9fd
line wrap: on
line diff
--- a/src/video/SDL_blit.h	Fri Jan 30 06:40:16 2009 +0000
+++ b/src/video/SDL_blit.h	Sat Feb 07 17:56:08 2009 +0000
@@ -240,6 +240,18 @@
 {									\
 	Pixel = (a<<24)|(r<<16)|(g<<8)|b;				\
 }
+#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a)				\
+{									\
+	Pixel = (r<<24)|(g<<16)|(b<<8)|a;				\
+}
+#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a)				\
+{									\
+	Pixel = (a<<24)|(b<<16)|(g<<8)|r;				\
+}
+#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)				\
+{									\
+	Pixel = (b<<24)|(g<<16)|(r<<8)|a;				\
+}
 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) 				\
 {									\
 	switch (bpp) {							\
@@ -347,6 +359,13 @@
 	b = ((Pixel>>16)&0xFF);						\
 	a = (Pixel>>24);						\
 }
+#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a)				\
+{									\
+	r = ((Pixel>>8)&0xFF);						\
+	g = ((Pixel>>16)&0xFF);						\
+	b = (Pixel>>24);						\
+	a = (Pixel&0xFF);						\
+}
 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)			   \
 do {									   \
 	switch (bpp) {							   \