From e5268813dcbdc0d90a081b2223ebc21749038635 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Fri, 7 Jul 2023 23:10:23 -0600 Subject: Better world --- src/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 94a9dd6..c769488 100644 --- a/src/util.h +++ b/src/util.h @@ -3,6 +3,13 @@ #ifndef UTIL_H #define UTIL_H +// Bit shit. +#define SET_BIT(b, n) (b | (0x1 << n)) +#define CLEAR_BIT(b, n) (b & ~(0x1 << n)) +#define IS_BIT_SET(b, n) ((b >> n) & 0x1) +#define TOGGLE_BIT(b, n) (b ^ (0x1 << n)) +#define HAS_FLAG(v, f) ((v & f) == f) + typedef struct AxisAngle { Vector3 axis; float angle; -- cgit v1.2.3