aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-05-21 15:25:42 +0200
committerMarvin Borner2021-05-21 15:25:42 +0200
commita69af1e2cc219f2f4010a6231dd32416a18437f2 (patch)
tree822571c69cc924adff0ec2c98c88f7bf928b43d5 /libs/libc/inc
parent5c27101d27a6fe9005ce4b95075d1dea5117d190 (diff)
Major GUI refactoring
Diffstat (limited to 'libs/libc/inc')
-rw-r--r--libs/libc/inc/vec.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/libc/inc/vec.h b/libs/libc/inc/vec.h
index a036931..bcd4cca 100644
--- a/libs/libc/inc/vec.h
+++ b/libs/libc/inc/vec.h
@@ -21,6 +21,7 @@ typedef struct vec3 {
#define vec2_div(a, b) ((vec2){ a.x / (b), a.y / (b) })
#define vec2_dot(a, b) ((u32)(a.x * b.x + a.y * b.y))
#define vec2_eq(a, b) (a.x == b.x && a.y == b.y)
+#define vec2_sum(a) ((u32)(a.x + a.y))
#define vec3(x, y, z) ((vec3){ (x), (y), (z) })
#define vec3to2(a) ((vec2){ a.x, a.y })
@@ -32,5 +33,6 @@ typedef struct vec3 {
#define vec3_eq(a, b) (a.x == b.x && a.y == b.y && a.z == c.z)
#define vec3_cross(a, b) \
((vec3){ a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x })
+#define vec3_sum(a) ((u32)(a.x + a.y + a.z))
#endif