aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorkotorifan <kotorifan05@gmail.com>2026-04-21 22:33:00 +0200
committerkotorifan <kotorifan05@gmail.com>2026-04-21 22:33:00 +0200
commita2c8cd78cdb0532496ee6487878b7c52a782e871 (patch)
treed3b5f3f33f82edbfea49812aeaaa7d7b04bda2d3 /src/common.h
parent1efdb8ab18042d9efc7c2e6addf7f414fbee5590 (diff)
downloadtrashbinphysics-a2c8cd78cdb0532496ee6487878b7c52a782e871.tar.gz
Doesn't compile yet, saving for just in case
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index c757489..2c43f90 100644
--- a/src/common.h
+++ b/src/common.h
@@ -24,9 +24,23 @@ typedef int_least32_t i32;
#define FORCE_GRAVITY_DEFAULT 1000.0f
#define FORCE_LINEAR_DAMPING_DEFAULT 0.995f;
+#define ARR_LEN(arr) (sizeof(arr)/sizeof(arr[0]))
+
typedef enum {
SHAPE_CIRCLE,
SHAPE_SQUARE,
SHAPE_RECTANGLE
} shape_t;
+
+shape_t get_random_shape(void)
+{
+ shape_t valid_shapes[] = {
+ SHAPE_CIRCLE,
+ SHAPE_SQUARE,
+ SHAPE_RECTANGLE
+ };
+
+ return valid_shapes(GetRandomValue(0, ARR(valid_shapes)));
+}
+
#endif // COMMON_H