Mercurial > hg > dmlib
diff libgfx.c @ 487:b89598501cec
Move dmCompareColor() to libgfx.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 12 Nov 2012 17:21:33 +0200 |
parents | 0359697eeb46 |
children | d400e32b62d9 |
line wrap: on
line diff
--- a/libgfx.c Sun Nov 11 14:36:17 2012 +0200 +++ b/libgfx.c Mon Nov 12 17:21:33 2012 +0200 @@ -15,6 +15,17 @@ #endif +BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha) +{ + if (c1->r == c2->r && + c1->g == c2->g && + c1->b == c2->b) + return alpha ? (c1->a == c2->a) : TRUE; + else + return FALSE; +} + + DMImage * dmImageAlloc(int width, int height) { DMImage *img = dmCalloc(1, sizeof(DMImage));