summaryrefslogtreecommitdiff
path: root/src/til.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-17 22:52:00 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-18 01:06:05 -0700
commitaf21b876efde47274a36d8a13d2c7503034227d0 (patch)
tree131358787058f953270fa388cc46e77389e9ddfd /src/til.h
parent209b11f99c801141b79802cd6c23a2b568286f75 (diff)
til: wire seed up to til randomizers
til_setting_desc_t.random() and til_module_randomize_setup() now take seeds. Note they are not taking a pointer to a shared seed, but instead receive the seed by value. If a caller wishes the seed to evolve on every invocation into these functions, it should simply insert a rand_r(&seed) in producing the supplied seed value. Within a given randomizer, the seed evolves when appropriate. But isolating the effects by default seems appropriate, so callers can easily have determinism within their respective scope regardless of how much nested random use occurs.
Diffstat (limited to 'src/til.h')
-rw-r--r--src/til.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/til.h b/src/til.h
index e38ad9c..7d0d637 100644
--- a/src/til.h
+++ b/src/til.h
@@ -44,7 +44,7 @@ void til_module_render(til_module_context_t *context, unsigned ticks, til_fb_fra
int til_module_create_context(const til_module_t *module, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup, til_module_context_t **res_context);
til_module_context_t * til_module_destroy_context(til_module_context_t *context);
int til_module_setup(til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
-int til_module_randomize_setup(const til_module_t *module, til_setup_t **res_setup, char **res_arg);
+int til_module_randomize_setup(const til_module_t *module, unsigned seed, til_setup_t **res_setup, char **res_arg);
int til_fragmenter_slice_per_cpu(til_module_context_t *context, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment);
int til_fragmenter_tile64(til_module_context_t *context, const til_fb_fragment_t *fragment, unsigned number, til_fb_fragment_t *res_fragment);
© All Rights Reserved