diff options
-rw-r--r-- | render.c | 9 | ||||
-rw-r--r-- | render.h | 1 |
2 files changed, 10 insertions, 0 deletions
@@ -156,6 +156,15 @@ Colour col_mul(Colour a, Colour b) { return r; } +Colour col_scl(Colour a, unsigned char s) { + Colour r; + r.r = (a.r * s) >> 8; + r.g = (a.g * s) >> 8; + r.b = (a.b * s) >> 8; + r.a = (a.a * s) >> 8; + return r; +} + void ren_begin(Renderer* r, Colour* t, int* d, int w, int h) { r->t = t; r->vp[0] = w; @@ -41,6 +41,7 @@ Colour make_black(void); Colour blend(Colour dst, Colour src); Colour blend_mod(Colour dst, Colour src, Colour mod); Colour col_mul(Colour a, Colour b); +Colour col_scl(Colour a, unsigned char s); typedef struct { Colour* p; |