Mercurial > sdl-ios-xcode
diff src/video/SDL_draw.h @ 5143:e743b9c3f6d6
Making the API simpler, the blend modes are "none, blend, add" and are supported by all renderers.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 31 Jan 2011 23:23:57 -0800 |
parents | f7b03b6838cb |
children |
line wrap: on
line diff
--- a/src/video/SDL_draw.h Mon Jan 31 22:53:45 2011 -0800 +++ b/src/video/SDL_draw.h Mon Jan 31 23:23:57 2011 -0800 @@ -70,16 +70,6 @@ setpixel; \ } while (0) -#define DRAW_SETPIXEL_MOD(getpixel, setpixel) \ -do { \ - unsigned sr, sg, sb, sa; sa; \ - getpixel; \ - sr = DRAW_MUL(sr, r); \ - sg = DRAW_MUL(sg, g); \ - sb = DRAW_MUL(sb, b); \ - setpixel; \ -} while (0) - #define DRAW_SETPIXELXY(x, y, type, bpp, op) \ do { \ type *pixel = (type *)((Uint8 *)dst->pixels + (y) * dst->pitch \ @@ -102,10 +92,6 @@ DRAW_SETPIXEL_ADD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB555 \ - DRAW_SETPIXEL_MOD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ - RGB555_FROM_RGB(*pixel, sr, sg, sb)) - #define DRAW_SETPIXELXY_RGB555(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB555) @@ -115,9 +101,6 @@ #define DRAW_SETPIXELXY_ADD_RGB555(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB555) -#define DRAW_SETPIXELXY_MOD_RGB555(x, y) \ - DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB555) - /* * Define draw operators for RGB565 */ @@ -133,10 +116,6 @@ DRAW_SETPIXEL_ADD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB565 \ - DRAW_SETPIXEL_MOD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ - RGB565_FROM_RGB(*pixel, sr, sg, sb)) - #define DRAW_SETPIXELXY_RGB565(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB565) @@ -146,9 +125,6 @@ #define DRAW_SETPIXELXY_ADD_RGB565(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB565) -#define DRAW_SETPIXELXY_MOD_RGB565(x, y) \ - DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB565) - /* * Define draw operators for RGB888 */ @@ -164,10 +140,6 @@ DRAW_SETPIXEL_ADD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ RGB888_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB888 \ - DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ - RGB888_FROM_RGB(*pixel, sr, sg, sb)) - #define DRAW_SETPIXELXY_RGB888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB888) @@ -177,9 +149,6 @@ #define DRAW_SETPIXELXY_ADD_RGB888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB888) -#define DRAW_SETPIXELXY_MOD_RGB888(x, y) \ - DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB888) - /* * Define draw operators for ARGB8888 */ @@ -195,10 +164,6 @@ DRAW_SETPIXEL_ADD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MOD_ARGB8888 \ - DRAW_SETPIXEL_MOD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ - ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) - #define DRAW_SETPIXELXY_ARGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ARGB8888) @@ -208,9 +173,6 @@ #define DRAW_SETPIXELXY_ADD_ARGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_ARGB8888) -#define DRAW_SETPIXELXY_MOD_ARGB8888(x, y) \ - DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_ARGB8888) - /* * Define draw operators for general RGB */ @@ -226,10 +188,6 @@ DRAW_SETPIXEL_ADD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB \ - DRAW_SETPIXEL_MOD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ - PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) - #define DRAW_SETPIXELXY2_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB) @@ -248,12 +206,6 @@ #define DRAW_SETPIXELXY4_ADD_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB) -#define DRAW_SETPIXELXY2_MOD_RGB(x, y) \ - DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB) - -#define DRAW_SETPIXELXY4_MOD_RGB(x, y) \ - DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB) - /* * Define draw operators for general RGBA @@ -270,10 +222,6 @@ DRAW_SETPIXEL_ADD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MOD_RGBA \ - DRAW_SETPIXEL_MOD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ - PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) - #define DRAW_SETPIXELXY4_RGBA(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGBA) @@ -283,9 +231,6 @@ #define DRAW_SETPIXELXY4_ADD_RGBA(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGBA) -#define DRAW_SETPIXELXY4_MOD_RGBA(x, y) \ - DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGBA) - /* * Define line drawing macro */