aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 23:10:23 -0600
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 23:10:23 -0600
commite5268813dcbdc0d90a081b2223ebc21749038635 (patch)
tree7c917996749e4123fb1fe49ddd1ed3b8f7e92334 /src/util.h
parenta90e1987de75cfecc2693952625af8cce507ae95 (diff)
Better world
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h7
1 files changed, 7 insertions, 0 deletions
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;