summaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-08-07 19:31:03 +1000
committerquou <quou@disroot.org>2024-08-07 19:31:03 +1000
commitf483b5d8ea24dc1b64db51dff03d933dc0793d00 (patch)
tree8e16c696da2e71a34715f25733ad3087a0269c3b /render.c
parentb0a5f59fe3bea9aab8f52016a90b6cbbcaea4571 (diff)
col_add
Diffstat (limited to 'render.c')
-rw-r--r--render.c9
1 files changed, 9 insertions, 0 deletions
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;