Mercurial > hg > dmlib
diff src/dmblitfunc.h @ 971:f654435df15e
Rename DMRGBA32 struct to DMColor and remove the original redundant DMColor
struct definition.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 27 Feb 2015 06:10:16 +0200 |
parents | 27949209238b |
children | e06abfde6c39 |
line wrap: on
line diff
--- a/src/dmblitfunc.h Fri Feb 27 05:33:48 2015 +0200 +++ b/src/dmblitfunc.h Fri Feb 27 06:10:16 2015 +0200 @@ -70,14 +70,14 @@ #define DM_BLITFUNC_SRC_BYTES 1 #define DM_BLITFUNC_DST_BYTES 4 #define DM_BLITFUNC_SRC_TYPE Uint8 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 -#define DM_BLITFUNC_VARS const DMRGBA32 *pal; +#define DM_BLITFUNC_DST_TYPE DMColor +#define DM_BLITFUNC_VARS const DMColor *pal; #define DM_BLITFUNC_INIT \ if (src->format->palette == NULL || src->format->palette->ncolors < 256) return -2; \ - pal = (DMRGBA32 *) src->format->palette->colors; + pal = (DMColor *) src->format->palette->colors; #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = pal[sp[FP_GETH16(xv)]]; \ + const DMColor q = pal[sp[FP_GETH16(xv)]]; \ dp->r += ((q.r - dp->r) * q.a) >> 8; \ dp->g += ((q.g - dp->g) * q.a) >> 8; \ dp->b += ((q.b - dp->b) * q.a) >> 8; \ @@ -131,10 +131,10 @@ #else -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[FP_GETH16(xv)]; \ + const DMColor q = sp[FP_GETH16(xv)]; \ dp->r += ((q.r - dp->r) * q.a) >> 8; \ dp->g += ((q.g - dp->g) * q.a) >> 8; \ dp->b += ((q.b - dp->b) * q.a) >> 8; \ @@ -149,12 +149,12 @@ #define DM_BLITFUNC_NAME dmScaledBlitSurface32to32TransparentX #define DM_BLITFUNC_SRC_BYTES 4 #define DM_BLITFUNC_DST_BYTES 4 -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INIT #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[FP_GETH16(xv)]; \ + const DMColor q = sp[FP_GETH16(xv)]; \ dp->r = (q.r * q.a + dp->r * dp->a) >> 8; \ dp->g = (q.g * q.a + dp->g * dp->a) >> 8; \ dp->b = (q.b * q.a + dp->b * dp->a) >> 8; \ @@ -221,10 +221,10 @@ #else -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[FP_GETH16(xv)]; \ + const DMColor q = sp[FP_GETH16(xv)]; \ const int a = (alpha * q.a) >> 8; \ dp->r += ((q.r - dp->r) * a) >> 8; \ dp->g += ((q.g - dp->g) * a) >> 8; \ @@ -256,11 +256,11 @@ #define DM_BLITFUNC_SRC_BYTES 1 #define DM_BLITFUNC_DST_BYTES 4 #define DM_BLITFUNC_SRC_TYPE Uint8 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 -#define DM_BLITFUNC_VARS const DMRGBA32 *pal; +#define DM_BLITFUNC_DST_TYPE DMColor +#define DM_BLITFUNC_VARS const DMColor *pal; #define DM_BLITFUNC_INIT \ if (src->format->palette == NULL || src->format->palette->ncolors < 256) return -2; \ - pal = (DMRGBA32 *) src->format->palette->colors; + pal = (DMColor *) src->format->palette->colors; #ifdef DM_USE_SIMD #define DM_BLITFUNC_INNER \ @@ -275,7 +275,7 @@ #define DM_BLITFUNC_FINISH asm("emms\n"); #else #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = pal[sp[FP_GETH16(xv)]]; \ + const DMColor q = pal[sp[FP_GETH16(xv)]]; \ const int qr = dp->r + q.r, qg = dp->g + q.g, qb = dp->b + q.b; \ dp->r = qr < 256 ? qr : 255; \ dp->g = qg < 256 ? qg : 255; \ @@ -307,10 +307,10 @@ #define DM_BLITFUNC_FINISH asm("emms\n"); #else -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[FP_GETH16(xv)]; \ + const DMColor q = sp[FP_GETH16(xv)]; \ const int qr = dp->r + q.r, qg = dp->g + q.g, qb = dp->b + q.b; \ dp->r = qr < 256 ? qr : 255; \ dp->g = qg < 256 ? qg : 255; \ @@ -393,14 +393,14 @@ #define DM_BLITFUNC_SRC_BYTES 1 #define DM_BLITFUNC_DST_BYTES 4 #define DM_BLITFUNC_SRC_TYPE Uint8 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 -#define DM_BLITFUNC_VARS const DMRGBA32 *pal; +#define DM_BLITFUNC_DST_TYPE DMColor +#define DM_BLITFUNC_VARS const DMColor *pal; #define DM_BLITFUNC_INIT \ if (src->format->palette == NULL || src->format->palette->ncolors < 256) return -2; \ - pal = (DMRGBA32 *) src->format->palette->colors; + pal = (DMColor *) src->format->palette->colors; #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = pal[sp[xv]]; \ + const DMColor q = pal[sp[xv]]; \ dp->r += ((q.r - dp->r) * q.a) >> 8; \ dp->g += ((q.g - dp->g) * q.a) >> 8; \ dp->b += ((q.b - dp->b) * q.a) >> 8; \ @@ -454,10 +454,10 @@ #else -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[xv]; \ + const DMColor q = sp[xv]; \ dp->r += ((q.r - dp->r) * q.a) >> 8; \ dp->g += ((q.g - dp->g) * q.a) >> 8; \ dp->b += ((q.b - dp->b) * q.a) >> 8; \ @@ -489,11 +489,11 @@ #define DM_BLITFUNC_SRC_BYTES 1 #define DM_BLITFUNC_DST_BYTES 4 #define DM_BLITFUNC_SRC_TYPE Uint8 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 -#define DM_BLITFUNC_VARS const DMRGBA32 *pal; +#define DM_BLITFUNC_DST_TYPE DMColor +#define DM_BLITFUNC_VARS const DMColor *pal; #define DM_BLITFUNC_INIT \ if (src->format->palette == NULL || src->format->palette->ncolors < 256) return -2; \ - pal = (DMRGBA32 *) src->format->palette->colors; + pal = (DMColor *) src->format->palette->colors; #ifdef DM_USE_SIMD #define DM_BLITFUNC_INNER \ @@ -508,7 +508,7 @@ #define DM_BLITFUNC_FINISH asm("emms\n"); #else #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = pal[sp[xv]]; \ + const DMColor q = pal[sp[xv]]; \ const int qr = dp->r + q.r, qg = dp->g + q.g, qb = dp->b + q.b; \ dp->r = qr < 256 ? qr : 255; \ dp->g = qg < 256 ? qg : 255; \ @@ -540,10 +540,10 @@ #define DM_BLITFUNC_FINISH asm("emms\n"); #else -#define DM_BLITFUNC_SRC_TYPE DMRGBA32 -#define DM_BLITFUNC_DST_TYPE DMRGBA32 +#define DM_BLITFUNC_SRC_TYPE DMColor +#define DM_BLITFUNC_DST_TYPE DMColor #define DM_BLITFUNC_INNER \ - const DMRGBA32 q = sp[xv]; \ + const DMColor q = sp[xv]; \ const int qr = dp->r + q.r, qg = dp->g + q.g, qb = dp->b + q.b; \ dp->r = qr < 256 ? qr : 255; \ dp->g = qg < 256 ? qg : 255; \