From 9c2f9a59096b5ec449c7557afb3220ed2597c4ea Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 4 Aug 2024 15:33:33 +1000 Subject: col_scl --- render.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index a55e062..3e5758b 100644 --- a/render.c +++ b/render.c @@ -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; -- cgit v1.2.3-54-g00ecf