Moved code and assets for the game to a seperate folder. Moved jansson and raylib to third_party.

This commit is contained in:
2025-12-16 11:47:55 +01:00
parent fd2dbf232d
commit 8cdbd5b162
63 changed files with 14 additions and 14 deletions

25
src/game/shared/random.c Normal file
View File

@@ -0,0 +1,25 @@
#include "random.h"
void random_init(Random_Generator *random_generator, uint32_t seed) {
if(seed == 0) {
seed = 1;
}
random_generator->seed = seed;
random_generator->state = random_generator->seed;
}
uint32_t random_u32(Random_Generator *random_generator) {
uint32_t x = random_generator->state;
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
random_generator->state = x;
return x;
}
uint32_t random_u32_range(Random_Generator *random_generator, uint32_t min, uint32_t max) {
return min + (random_u32(random_generator) % (max - min + 1));
}