refactor: reorganize pxl8 into client/src/ module structure
- core/: main entry, types, logging, I/O, RNG - asset/: ase loader, cart, save, embed - gfx/: graphics, animation, atlas, fonts, tilemap, transitions - sfx/: audio - script/: lua/fennel runtime, REPL - hal/: platform abstraction (SDL3) - world/: BSP, world, procedural gen - math/: math utilities - game/: GUI, replay - lua/: Lua API modules
This commit is contained in:
parent
272e0bc615
commit
49256db1bd
107 changed files with 6678 additions and 3715 deletions
|
|
@ -1,24 +0,0 @@
|
|||
#include "pxl8_rng.h"
|
||||
|
||||
void pxl8_rng_seed(pxl8_rng* rng, u32 seed) {
|
||||
if (!rng) return;
|
||||
rng->state = seed ? seed : 1;
|
||||
}
|
||||
|
||||
u32 pxl8_rng_next(pxl8_rng* rng) {
|
||||
if (!rng) return 0;
|
||||
rng->state ^= rng->state << 13;
|
||||
rng->state ^= rng->state >> 17;
|
||||
rng->state ^= rng->state << 5;
|
||||
return rng->state;
|
||||
}
|
||||
|
||||
f32 pxl8_rng_f32(pxl8_rng* rng) {
|
||||
return (f32)pxl8_rng_next(rng) / (f32)0xFFFFFFFF;
|
||||
}
|
||||
|
||||
i32 pxl8_rng_range(pxl8_rng* rng, i32 min, i32 max) {
|
||||
if (min >= max) return min;
|
||||
u32 range = (u32)(max - min);
|
||||
return min + (i32)(pxl8_rng_next(rng) % range);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue