From f483b5d8ea24dc1b64db51dff03d933dc0793d00 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 7 Aug 2024 19:31:03 +1000 Subject: col_add --- render.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index f50dd04..f42673b 100644 --- a/render.c +++ b/render.c @@ -165,6 +165,15 @@ Colour col_scl(Colour a, unsigned char s) { return r; } +Colour col_add(Colour a, Colour b) { + Colour r; + r.r = ((int)a.r + (int)b.r) & 0xff; + r.g = ((int)a.g + (int)b.g) & 0xff; + r.b = ((int)a.b + (int)b.b) & 0xff; + r.a = ((int)a.a + (int)b.a) & 0xff; + return r; +} + void ren_begin(Renderer* r, Colour* t, int* d, int w, int h) { r->t = t; r->vp[0] = w; -- cgit v1.2.3-54-g00ecf