src/render/software/SDL_draw.h
changeset 5981 75caa8a7d559
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
equal deleted inserted replaced
5980:612b41c44af1 5981:75caa8a7d559
    43 #define DRAW_FASTSETPIXELXY2(x, y) DRAW_FASTSETPIXELXY(x, y, Uint16, 2, color)
    43 #define DRAW_FASTSETPIXELXY2(x, y) DRAW_FASTSETPIXELXY(x, y, Uint16, 2, color)
    44 #define DRAW_FASTSETPIXELXY4(x, y) DRAW_FASTSETPIXELXY(x, y, Uint32, 4, color)
    44 #define DRAW_FASTSETPIXELXY4(x, y) DRAW_FASTSETPIXELXY(x, y, Uint32, 4, color)
    45 
    45 
    46 #define DRAW_SETPIXEL(setpixel) \
    46 #define DRAW_SETPIXEL(setpixel) \
    47 do { \
    47 do { \
    48     unsigned sr = r, sg = g, sb = b, sa = a; \
    48     unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \
    49     setpixel; \
    49     setpixel; \
    50 } while (0)
    50 } while (0)
    51 
    51 
    52 #define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
    52 #define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
    53 do { \
    53 do { \
    54     unsigned sr, sg, sb, sa; sa; \
    54     unsigned sr, sg, sb, sa; (void) sa; \
    55     getpixel; \
    55     getpixel; \
    56     sr = DRAW_MUL(inva, sr) + r; \
    56     sr = DRAW_MUL(inva, sr) + r; \
    57     sg = DRAW_MUL(inva, sg) + g; \
    57     sg = DRAW_MUL(inva, sg) + g; \
    58     sb = DRAW_MUL(inva, sb) + b; \
    58     sb = DRAW_MUL(inva, sb) + b; \
    59     setpixel; \
    59     setpixel; \
    60 } while (0)
    60 } while (0)
    61 
    61 
    62 #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \
    62 #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \
    63 do { \
    63 do { \
    64     unsigned sr, sg, sb, sa; sa; \
    64     unsigned sr, sg, sb, sa; (void) sa; \
    65     getpixel; \
    65     getpixel; \
    66     sr += r; if (sr > 0xff) sr = 0xff; \
    66     sr += r; if (sr > 0xff) sr = 0xff; \
    67     sg += g; if (sg > 0xff) sg = 0xff; \
    67     sg += g; if (sg > 0xff) sg = 0xff; \
    68     sb += b; if (sb > 0xff) sb = 0xff; \
    68     sb += b; if (sb > 0xff) sb = 0xff; \
    69     setpixel; \
    69     setpixel; \
    70 } while (0)
    70 } while (0)
    71 
    71 
    72 #define DRAW_SETPIXEL_MOD(getpixel, setpixel) \
    72 #define DRAW_SETPIXEL_MOD(getpixel, setpixel) \
    73 do { \
    73 do { \
    74     unsigned sr, sg, sb, sa; sa; \
    74     unsigned sr, sg, sb, sa; (void) sa; \
    75     getpixel; \
    75     getpixel; \
    76     sr = DRAW_MUL(sr, r); \
    76     sr = DRAW_MUL(sr, r); \
    77     sg = DRAW_MUL(sg, g); \
    77     sg = DRAW_MUL(sg, g); \
    78     sb = DRAW_MUL(sb, b); \
    78     sb = DRAW_MUL(sb, b); \
    79     setpixel; \
    79     setpixel; \