rename rand.dat -> noise.dat
This commit is contained in:
parent
d78adcb9c9
commit
a5111c5b51
@ -40,9 +40,9 @@ struct rng_startup_receipt rng_startup(struct resource_startup_receipt *resource
|
||||
{
|
||||
(UNUSED)resource_sr;
|
||||
G.arena = arena_alloc(GIGABYTE(64));
|
||||
struct string rand_path = STR("res/rand.dat");
|
||||
if (resource_exists(rand_path)) {
|
||||
struct resource r = resource_open(rand_path);
|
||||
struct string noise_path = STR("res/noise.dat");
|
||||
if (resource_exists(noise_path)) {
|
||||
struct resource r = resource_open(noise_path);
|
||||
G.noise_count = r.bytes.size / sizeof(*G.noise);
|
||||
G.noise = arena_push_array(&G.arena, u64, G.noise_count);
|
||||
MEMCPY(G.noise, r.bytes.data, r.bytes.size);
|
||||
@ -84,6 +84,8 @@ f64 rng_rand_f64(f64 range_start, f64 range_end)
|
||||
/* ========================== *
|
||||
* Noise
|
||||
* Functions that return a deterministic pre-computed random number based on the provided seed
|
||||
*
|
||||
* NOTE: Noise pattern repeats after period depending on how much noise data exists in noise.dat
|
||||
* ========================== */
|
||||
|
||||
u32 rng_noise_u32(u32 seed)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user