diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-05-21 20:26:32 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-05-21 20:26:32 -0700 |
commit | 9b8660a62e3c5c9ad8f70c0d56ccaac7c4a531fc (patch) | |
tree | 039336351d80f7e70e1d136d256a364a93a2da1d /src/modules/snow | |
parent | 192a89a7f9f396fff4eb6b0836f597c376e98932 (diff) |
til: supply a seed to til_module_t.create_context()
In the recent surge of ADD-style rtv+compose focused development,
a bunch of modules were changed to randomize initial states at
context_create() so they wouldn't be so repetitive.
But the way this was done in a way that made it impossible to
suppress the randomized initial state, which sometimes may be
desirable in compositions. Imagine for instance something like
the checkers module, rendering one module in the odd cells, and
another module into the even cells. Imagine if these modules are
actually the same, but if checkers used one seed for all the odd
cells and another seed for all the even cells. If the modules
used actually utilized the seed provided, checkers would be able
to differentiate the odd from even by seeding them differently
even when the modules are the same.
This commit is a step in that direction, but rototiller and all
the composite modules (rtv,compose,montage) are simply passing
rand() as the seeds. Also none of the modules have yet been
modified to actually make use of these seeds.
Subsequent commits will update modules to seed their
pseudo-randomized initial state from the seed value rather than
always calling things like rand() themselves.
Diffstat (limited to 'src/modules/snow')
-rw-r--r-- | src/modules/snow/snow.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c index 8befc92..82ad847 100644 --- a/src/modules/snow/snow.c +++ b/src/modules/snow/snow.c @@ -20,7 +20,7 @@ typedef struct snow_context_t { } snow_context_t; -static void * snow_create_context(unsigned ticks, unsigned n_cpus, til_setup_t *setup) +static void * snow_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup) { snow_context_t *ctxt; |