comparison 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
comparison
equal deleted inserted replaced
3053:aa34d1180d30 3054:8d93bfecb9dc
238 } 238 }
239 #define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ 239 #define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \
240 { \ 240 { \
241 Pixel = (a<<24)|(r<<16)|(g<<8)|b; \ 241 Pixel = (a<<24)|(r<<16)|(g<<8)|b; \
242 } 242 }
243 #define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \
244 { \
245 Pixel = (r<<24)|(g<<16)|(b<<8)|a; \
246 }
247 #define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \
248 { \
249 Pixel = (a<<24)|(b<<16)|(g<<8)|r; \
250 }
251 #define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \
252 { \
253 Pixel = (b<<24)|(g<<16)|(r<<8)|a; \
254 }
243 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ 255 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \
244 { \ 256 { \
245 switch (bpp) { \ 257 switch (bpp) { \
246 case 2: { \ 258 case 2: { \
247 Uint16 Pixel; \ 259 Uint16 Pixel; \
344 { \ 356 { \
345 r = (Pixel&0xFF); \ 357 r = (Pixel&0xFF); \
346 g = ((Pixel>>8)&0xFF); \ 358 g = ((Pixel>>8)&0xFF); \
347 b = ((Pixel>>16)&0xFF); \ 359 b = ((Pixel>>16)&0xFF); \
348 a = (Pixel>>24); \ 360 a = (Pixel>>24); \
361 }
362 #define RGBA_FROM_BGRA8888(Pixel, r, g, b, a) \
363 { \
364 r = ((Pixel>>8)&0xFF); \
365 g = ((Pixel>>16)&0xFF); \
366 b = (Pixel>>24); \
367 a = (Pixel&0xFF); \
349 } 368 }
350 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ 369 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \
351 do { \ 370 do { \
352 switch (bpp) { \ 371 switch (bpp) { \
353 case 2: \ 372 case 2: \