From a2c8cd78cdb0532496ee6487878b7c52a782e871 Mon Sep 17 00:00:00 2001 From: kotorifan Date: Tue, 21 Apr 2026 22:33:00 +0200 Subject: Doesn't compile yet, saving for just in case --- src/common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/common.h') 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 -- cgit v1.3