summaryrefslogtreecommitdiff
path: root/src/modules/sparkler/sparkler.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-07-20 21:06:31 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-07-20 21:06:31 -0700
commitb38db01c835fa222aa11ace3a2d84095fe2c3f83 (patch)
tree18464eac0c46a1e8a82f96faadc370066d8bf61c /src/modules/sparkler/sparkler.c
parentb68ec04f86f83ba3d7926ffafc1d8a6456e72c05 (diff)
modules/sparkler: s/rand/rand_r/ and wire up seed
This is a little contorted but not too bad. The input to particles_new() is just a const conf struct, so instead of passing in the seed value for particles_t to contain, a pointer to where the seed lives is passed in via the conf. This requires the caller to persist a seed somewhere outside the particles instance, but at least in rototiller we already have that conveniently in til_module_context_t.
Diffstat (limited to 'src/modules/sparkler/sparkler.c')
-rw-r--r--src/modules/sparkler/sparkler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c
index c93c018..f0f2cb6 100644
--- a/src/modules/sparkler/sparkler.c
+++ b/src/modules/sparkler/sparkler.c
@@ -53,6 +53,7 @@ static til_module_context_t * sparkler_create_context(unsigned seed, unsigned ti
.show_bsp_matches = ((sparkler_setup_t *)setup)->show_bsp_matches,
.show_bsp_leafs_min_depth = ((sparkler_setup_t *)setup)->show_bsp_leafs_min_depth,
.show_bsp_matches_affected_only = ((sparkler_setup_t *)setup)->show_bsp_matches_affected_only,
+ .seedp = &ctxt->til_module_context.seed,
});
if (!ctxt->particles) {
free(ctxt);
© All Rights Reserved