summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/blinds/blinds.c6
-rw-r--r--src/modules/checkers/checkers.c12
-rw-r--r--src/modules/compose/compose.c22
-rw-r--r--src/modules/drizzle/drizzle.c10
-rw-r--r--src/modules/flui2d/flui2d.c8
-rw-r--r--src/modules/julia/julia.c8
-rw-r--r--src/modules/meta2d/meta2d.c8
-rw-r--r--src/modules/moire/moire.c8
-rw-r--r--src/modules/montage/montage.c18
-rw-r--r--src/modules/pixbounce/pixbounce.c6
-rw-r--r--src/modules/plasma/plasma.c8
-rw-r--r--src/modules/plato/plato.c10
-rw-r--r--src/modules/ray/ray.c10
-rw-r--r--src/modules/roto/roto.c8
-rw-r--r--src/modules/rtv/rtv.c20
-rw-r--r--src/modules/shapes/shapes.c6
-rw-r--r--src/modules/snow/snow.c8
-rw-r--r--src/modules/sparkler/sparkler.c8
-rw-r--r--src/modules/spiro/spiro.c6
-rw-r--r--src/modules/stars/stars.c16
-rw-r--r--src/modules/strobe/strobe.c10
-rw-r--r--src/modules/submit/submit.c8
-rw-r--r--src/modules/swab/swab.c8
-rw-r--r--src/modules/swarm/swarm.c6
-rw-r--r--src/modules/voronoi/voronoi.c8
25 files changed, 123 insertions, 123 deletions
diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c
index 890b569..b0aebdb 100644
--- a/src/modules/blinds/blinds.c
+++ b/src/modules/blinds/blinds.c
@@ -37,14 +37,14 @@ static blinds_setup_t blinds_default_setup = {
};
-static til_module_context_t * blinds_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * blinds_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
blinds_context_t *ctxt;
if (!setup)
setup = &blinds_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(blinds_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(blinds_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -83,7 +83,7 @@ static inline void draw_blind_vertical(til_fb_fragment_t *fragment, unsigned col
/* draw blinds over the fragment */
-static void blinds_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void blinds_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
blinds_context_t *ctxt = (blinds_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c
index b7a4f11..c4a419f 100644
--- a/src/modules/checkers/checkers.c
+++ b/src/modules/checkers/checkers.c
@@ -79,7 +79,7 @@ static checkers_setup_t checkers_default_setup = {
};
-static til_module_context_t * checkers_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * checkers_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
size_t size = sizeof(checkers_context_t);
checkers_context_t *ctxt;
@@ -90,7 +90,7 @@ static til_module_context_t * checkers_create_context(unsigned seed, unsigned ti
if (((checkers_setup_t *)setup)->fill_module)
size += sizeof(til_module_context_t *) * n_cpus;
- ctxt = til_module_context_new(size, ticks, seed, n_cpus, path);
+ ctxt = til_module_context_new(stream, size, ticks, seed, n_cpus, path);
if (!ctxt)
return NULL;
@@ -104,7 +104,7 @@ static til_module_context_t * checkers_create_context(unsigned seed, unsigned ti
/* since checkers is already threaded, create an n_cpus=1 context per-cpu */
for (unsigned i = 0; i < n_cpus; i++) /* TODO: errors */
- (void) til_module_create_context(module, seed, ticks, 1, path /* FIXME TODO path-per-context breaks down on these per-cpu-context abuses */, module_setup, &ctxt->fill_module_contexts[i]);
+ (void) til_module_create_context(module, stream, seed, ticks, 1, path /* FIXME TODO path-per-context breaks down on these per-cpu-context abuses */, module_setup, &ctxt->fill_module_contexts[i]);
/* XXX: it would be interesting to support various patterns/layouts by varying the seed, but this will require
* more complex context allocation strategies while also maintaining the per-cpu allocation.
@@ -227,7 +227,7 @@ static int checkers_fragmenter(til_module_context_t *context, const til_fb_fragm
}
-static void checkers_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void checkers_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
checkers_context_t *ctxt = (checkers_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -255,7 +255,7 @@ static inline unsigned hash(unsigned x)
}
-static void checkers_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void checkers_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
checkers_context_t *ctxt = (checkers_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -323,7 +323,7 @@ static void checkers_render_fragment(til_module_context_t *context, unsigned tic
til_fb_fragment_fill(fragment, flags, color);
else {
/* TODO: we need a way to send down color and flags, and use the module render as a brush of sorts */
- til_module_render(ctxt->fill_module_contexts[cpu], ticks, fragment_ptr);
+ til_module_render(ctxt->fill_module_contexts[cpu], stream, ticks, fragment_ptr);
}
}
}
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index a73f2b7..92f6fd2 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -47,9 +47,9 @@ typedef struct compose_setup_t {
char *layers[];
} compose_setup_t;
-static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
+static til_module_context_t * compose_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void compose_destroy_context(til_module_context_t *context);
-static void compose_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
+static void compose_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
static int compose_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
static compose_setup_t compose_default_setup = {
@@ -67,7 +67,7 @@ til_module_t compose_module = {
};
-static til_module_context_t * compose_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * compose_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
compose_context_t *ctxt;
size_t n;
@@ -77,7 +77,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
for (n = 0; ((compose_setup_t *)setup)->layers[n]; n++);
- ctxt = til_module_context_new(sizeof(compose_context_t) + n * sizeof(compose_layer_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(compose_context_t) + n * sizeof(compose_layer_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -89,7 +89,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
(void) til_module_randomize_setup(layer_module, rand_r(&seed), &layer_setup, NULL);
ctxt->layers[i].module = layer_module;
- (void) til_module_create_context(layer_module, rand_r(&seed), ticks, 0, path, layer_setup, &ctxt->layers[i].module_ctxt);
+ (void) til_module_create_context(layer_module, stream, rand_r(&seed), ticks, 0, path, layer_setup, &ctxt->layers[i].module_ctxt);
til_setup_free(layer_setup);
ctxt->n_layers++;
@@ -101,7 +101,7 @@ static til_module_context_t * compose_create_context(unsigned seed, unsigned tic
ctxt->texture.module = til_lookup_module(((compose_setup_t *)setup)->texture);
(void) til_module_randomize_setup(ctxt->texture.module, rand_r(&seed), &texture_setup, NULL);
- (void) til_module_create_context(ctxt->texture.module, rand_r(&seed), ticks, 0, path, texture_setup, &ctxt->texture.module_ctxt);
+ (void) til_module_create_context(ctxt->texture.module, stream, rand_r(&seed), ticks, 0, path, texture_setup, &ctxt->texture.module_ctxt);
til_setup_free(texture_setup);
}
@@ -125,7 +125,7 @@ static void compose_destroy_context(til_module_context_t *context)
}
-static void compose_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void compose_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
compose_context_t *ctxt = (compose_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr, *texture = &ctxt->texture_fb;
@@ -149,17 +149,17 @@ static void compose_render_fragment(til_module_context_t *context, unsigned tick
ctxt->texture_fb.cleared = 0;
/* XXX: if when snapshotting becomes a thing, ctxt->texture_fb is snapshottable, this will likely break as-is */
- til_module_render(ctxt->texture.module_ctxt, ticks, &texture);
- til_module_render(ctxt->layers[0].module_ctxt, ticks, &fragment);
+ til_module_render(ctxt->texture.module_ctxt, stream, ticks, &texture);
+ til_module_render(ctxt->layers[0].module_ctxt, stream, ticks, &fragment);
for (size_t i = 1; i < ctxt->n_layers; i++) {
fragment->texture = texture; /* keep forcing our texture, in case something below us installed their own. */
- til_module_render(ctxt->layers[i].module_ctxt, ticks, &fragment);
+ til_module_render(ctxt->layers[i].module_ctxt, stream, ticks, &fragment);
}
} else {
for (size_t i = 0; i < ctxt->n_layers; i++) {
fragment->texture = NULL; /* keep forcing no texture, in case something below us installed their own. TODO: more formally define texture semantics as it pertains to module nesting */
- til_module_render(ctxt->layers[i].module_ctxt, ticks, &fragment);
+ til_module_render(ctxt->layers[i].module_ctxt, stream, ticks, &fragment);
}
}
diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c
index e5b79eb..307e0d3 100644
--- a/src/modules/drizzle/drizzle.c
+++ b/src/modules/drizzle/drizzle.c
@@ -85,14 +85,14 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * drizzle_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * drizzle_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
drizzle_context_t *ctxt;
if (!setup)
setup = &drizzle_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(drizzle_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(drizzle_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -117,7 +117,7 @@ static void drizzle_destroy_context(til_module_context_t *context)
}
-static void drizzle_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void drizzle_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
drizzle_context_t *ctxt = (drizzle_context_t *)context;
@@ -249,7 +249,7 @@ static void puddle_sample_normal(const puddle_t *puddle, const v2f_t *coordinate
}
-static void drizzle_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void drizzle_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
drizzle_context_t *ctxt = (drizzle_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -329,7 +329,7 @@ static void drizzle_render_fragment(til_module_context_t *context, unsigned tick
}
-static void drizzle_finish_frame(til_module_context_t *context, unsigned int ticks, til_fb_fragment_t **fragment_ptr)
+static void drizzle_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned int ticks, til_fb_fragment_t **fragment_ptr)
{
drizzle_context_t *ctxt = (drizzle_context_t *)context;
diff --git a/src/modules/flui2d/flui2d.c b/src/modules/flui2d/flui2d.c
index 4b75520..9ae3e94 100644
--- a/src/modules/flui2d/flui2d.c
+++ b/src/modules/flui2d/flui2d.c
@@ -245,7 +245,7 @@ static void gamma_init(float gamma)
}
-static til_module_context_t * flui2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * flui2d_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
flui2d_context_t *ctxt;
@@ -253,7 +253,7 @@ static til_module_context_t * flui2d_create_context(unsigned seed, unsigned tick
if (!setup)
setup = &flui2d_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(flui2d_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(flui2d_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -273,7 +273,7 @@ static til_module_context_t * flui2d_create_context(unsigned seed, unsigned tick
/* Prepare a frame for concurrent drawing of fragment using multiple fragments */
-static void flui2d_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void flui2d_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
flui2d_context_t *ctxt = (flui2d_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -334,7 +334,7 @@ static void flui2d_prepare_frame(til_module_context_t *context, unsigned ticks,
/* Draw a the flui2d densities */
-static void flui2d_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void flui2d_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
flui2d_context_t *ctxt = (flui2d_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c
index 0dcefe5..65a15b6 100644
--- a/src/modules/julia/julia.c
+++ b/src/modules/julia/julia.c
@@ -67,11 +67,11 @@ static uint32_t colors[] = {
};
-static til_module_context_t * julia_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * julia_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
julia_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(julia_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(julia_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -106,7 +106,7 @@ static inline unsigned julia_iter(float real, float imag, float creal, float cim
/* Prepare a frame for concurrent drawing of fragment using multiple fragments */
-static void julia_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void julia_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
julia_context_t *ctxt = (julia_context_t *)context;
@@ -133,7 +133,7 @@ static void julia_prepare_frame(til_module_context_t *context, unsigned ticks, t
/* Draw a morphing Julia set */
-static void julia_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void julia_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
julia_context_t *ctxt = (julia_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/meta2d/meta2d.c b/src/modules/meta2d/meta2d.c
index 978f32f..6d9d307 100644
--- a/src/modules/meta2d/meta2d.c
+++ b/src/modules/meta2d/meta2d.c
@@ -67,11 +67,11 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * meta2d_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * meta2d_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
meta2d_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(meta2d_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(meta2d_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -101,7 +101,7 @@ static void meta2d_destroy_context(til_module_context_t *context)
}
-static void meta2d_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void meta2d_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
meta2d_context_t *ctxt = (meta2d_context_t *)context;
@@ -178,7 +178,7 @@ static void meta2d_prepare_frame(til_module_context_t *context, unsigned ticks,
}
-static void meta2d_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void meta2d_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
meta2d_context_t *ctxt = (meta2d_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/moire/moire.c b/src/modules/moire/moire.c
index 9bf782c..b010cdd 100644
--- a/src/modules/moire/moire.c
+++ b/src/modules/moire/moire.c
@@ -47,14 +47,14 @@ static moire_setup_t moire_default_setup = {
};
-static til_module_context_t * moire_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * moire_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
moire_context_t *ctxt;
if (!setup)
setup = &moire_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(moire_context_t) + ((moire_setup_t *)setup)->n_centers * sizeof(moire_center_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(moire_context_t) + ((moire_setup_t *)setup)->n_centers * sizeof(moire_center_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -71,7 +71,7 @@ static til_module_context_t * moire_create_context(unsigned seed, unsigned ticks
}
-static void moire_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void moire_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
moire_context_t *ctxt = (moire_context_t *)context;
@@ -84,7 +84,7 @@ static void moire_prepare_frame(til_module_context_t *context, unsigned ticks, t
}
-static void moire_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void moire_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
moire_context_t *ctxt = (moire_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c
index 6697bc5..3ab944f 100644
--- a/src/modules/montage/montage.c
+++ b/src/modules/montage/montage.c
@@ -16,10 +16,10 @@ typedef struct montage_context_t {
size_t n_modules;
} montage_context_t;
-static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
+static til_module_context_t * montage_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void montage_destroy_context(til_module_context_t *context);
-static void montage_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan);
-static void montage_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
+static void montage_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan);
+static void montage_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
til_module_t montage_module = {
@@ -32,13 +32,13 @@ til_module_t montage_module = {
};
-static til_module_context_t * montage_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * montage_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
const til_module_t **modules, *rtv_module, *compose_module;
size_t n_modules;
montage_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(montage_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(montage_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -92,7 +92,7 @@ static til_module_context_t * montage_create_context(unsigned seed, unsigned tic
(void) til_module_randomize_setup(module, rand_r(&seed), &setup, NULL);
/* FIXME errors */
- (void) til_module_create_context(module, rand_r(&seed), ticks, 1, path, setup, &ctxt->contexts[i]);
+ (void) til_module_create_context(module, stream, rand_r(&seed), ticks, 1, path, setup, &ctxt->contexts[i]);
til_setup_free(setup);
}
@@ -210,13 +210,13 @@ static int montage_fragmenter(til_module_context_t *context, const til_fb_fragme
}
-static void montage_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void montage_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
*res_frame_plan = (til_frame_plan_t){ .fragmenter = montage_fragmenter };
}
-static void montage_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void montage_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
montage_context_t *ctxt = (montage_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -227,5 +227,5 @@ static void montage_render_fragment(til_module_context_t *context, unsigned tick
return;
}
- til_module_render(ctxt->contexts[fragment->number], ticks, fragment_ptr);
+ til_module_render(ctxt->contexts[fragment->number], stream, ticks, fragment_ptr);
}
diff --git a/src/modules/pixbounce/pixbounce.c b/src/modules/pixbounce/pixbounce.c
index f10bd5b..8a26be2 100644
--- a/src/modules/pixbounce/pixbounce.c
+++ b/src/modules/pixbounce/pixbounce.c
@@ -240,11 +240,11 @@ static uint32_t pick_color(unsigned *seedp)
return makergb(rand_r(seedp)%256, rand_r(seedp)%256, rand_r(seedp)%256, 1);
}
-static til_module_context_t * pixbounce_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * pixbounce_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
pixbounce_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(pixbounce_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(pixbounce_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -260,7 +260,7 @@ static til_module_context_t * pixbounce_create_context(unsigned seed, unsigned t
return &ctxt->til_module_context;
}
-static void pixbounce_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void pixbounce_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
pixbounce_context_t *ctxt = (pixbounce_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/plasma/plasma.c b/src/modules/plasma/plasma.c
index f49b396..c42efd2 100644
--- a/src/modules/plasma/plasma.c
+++ b/src/modules/plasma/plasma.c
@@ -53,7 +53,7 @@ static void init_plasma(int32_t *costab, int32_t *sintab)
}
-static til_module_context_t * plasma_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * plasma_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
plasma_context_t *ctxt;
@@ -64,7 +64,7 @@ static til_module_context_t * plasma_create_context(unsigned seed, unsigned tick
init_plasma(costab, sintab);
}
- ctxt = til_module_context_new(sizeof(plasma_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(plasma_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -75,7 +75,7 @@ static til_module_context_t * plasma_create_context(unsigned seed, unsigned tick
/* Prepare a frame for concurrent drawing of fragment using multiple fragments */
-static void plasma_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void plasma_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
plasma_context_t *ctxt = (plasma_context_t *)context;
@@ -85,7 +85,7 @@ static void plasma_prepare_frame(til_module_context_t *context, unsigned ticks,
/* Draw a plasma effect */
-static void plasma_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void plasma_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
plasma_context_t *ctxt = (plasma_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c
index 1dc56a3..4334eda 100644
--- a/src/modules/plato/plato.c
+++ b/src/modules/plato/plato.c
@@ -630,11 +630,11 @@ static void draw_polyhedron(const polyhedron_t *polyhedron, m4f_t *transform, ti
}
-static til_module_context_t * plato_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * plato_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
plato_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(plato_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(plato_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -647,14 +647,14 @@ static til_module_context_t * plato_create_context(unsigned seed, unsigned ticks
}
-static void plato_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void plato_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
plato_context_t *ctxt = (plato_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
/* since we don't automate the rates ourselves, we don't care about the tap return values */
- (void) til_stream_tap_context(fragment->stream, context, &ctxt->taps.orbit_rate);
- (void) til_stream_tap_context(fragment->stream, context, &ctxt->taps.spin_rate);
+ (void) til_stream_tap_context(stream, context, &ctxt->taps.orbit_rate);
+ (void) til_stream_tap_context(stream, context, &ctxt->taps.spin_rate);
ctxt->r += (float)(ticks - context->ticks) * (*ctxt->orbit_rate * .001f);
ctxt->rr += (float)(ticks - context->ticks) * (*ctxt->spin_rate * .001f);
diff --git a/src/modules/ray/ray.c b/src/modules/ray/ray.c
index e3887b6..0017da3 100644
--- a/src/modules/ray/ray.c
+++ b/src/modules/ray/ray.c
@@ -132,11 +132,11 @@ typedef struct ray_context_t {
} ray_context_t;
-static til_module_context_t * ray_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * ray_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
ray_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(ray_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(ray_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -145,7 +145,7 @@ static til_module_context_t * ray_create_context(unsigned seed, unsigned ticks,
/* prepare a frame for concurrent rendering */
-static void ray_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void ray_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
ray_context_t *ctxt = (ray_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -178,7 +178,7 @@ static void ray_prepare_frame(til_module_context_t *context, unsigned ticks, til
/* ray trace a simple scene into the fragment */
-static void ray_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void ray_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
ray_context_t *ctxt = (ray_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -187,7 +187,7 @@ static void ray_render_fragment(til_module_context_t *context, unsigned ticks, u
}
-static void ray_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr)
+static void ray_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr)
{
ray_context_t *ctxt = (ray_context_t *)context;
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index c5106ab..1b20e2e 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -62,7 +62,7 @@ static void init_roto(uint8_t texture[256][256], int32_t *costab, int32_t *sinta
}
-static til_module_context_t * roto_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * roto_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
static int initialized;
roto_context_t *ctxt;
@@ -73,7 +73,7 @@ static til_module_context_t * roto_create_context(unsigned seed, unsigned ticks,
init_roto(texture, costab, sintab);
}
- ctxt = til_module_context_new(sizeof(roto_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(roto_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -182,7 +182,7 @@ static uint32_t bilerp_color(uint8_t texture[256][256], color_t *palette, int tx
/* prepare a frame for concurrent rendering */
-static void roto_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void roto_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
roto_context_t *ctxt = (roto_context_t *)context;
@@ -208,7 +208,7 @@ static void roto_prepare_frame(til_module_context_t *context, unsigned ticks, ti
/* Draw a rotating checkered 256x256 texture into fragment. */
-static void roto_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void roto_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
roto_context_t *ctxt = (roto_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index a8cac2a..b7f500a 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -61,10 +61,10 @@ typedef struct rtv_setup_t {
} rtv_setup_t;
static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks);
-static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
+static til_module_context_t * rtv_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup);
static void rtv_destroy_context(til_module_context_t *context);
-static void rtv_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
-static void rtv_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr);
+static void rtv_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr);
+static void rtv_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr);
static int rtv_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
static rtv_setup_t rtv_default_setup = {
@@ -188,7 +188,7 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks)
}
if (!ctxt->channel->module_ctxt)
- (void) til_module_create_context(ctxt->channel->module, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->til_module_context.path, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
+ (void) til_module_create_context(ctxt->channel->module, ctxt->til_module_context.stream, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->til_module_context.path, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
ctxt->channel->last_on_time = now;
}
@@ -215,7 +215,7 @@ static int rtv_should_skip_module(const rtv_setup_t *setup, const til_module_t *
}
-static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * rtv_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
rtv_context_t *ctxt;
const til_module_t **modules;
@@ -232,7 +232,7 @@ static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks,
n_channels++;
}
- ctxt = til_module_context_new(sizeof(rtv_context_t) + n_channels * sizeof(rtv_channel_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(rtv_context_t) + n_channels * sizeof(rtv_channel_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -244,7 +244,7 @@ static til_module_context_t * rtv_create_context(unsigned seed, unsigned ticks,
ctxt->snow_channel.module = &rtv_none_module;
if (((rtv_setup_t *)setup)->snow_module) {
ctxt->snow_channel.module = til_lookup_module(((rtv_setup_t *)setup)->snow_module);
- (void) til_module_create_context(ctxt->snow_channel.module, rand_r(&seed), ticks, 0, path, NULL, &ctxt->snow_channel.module_ctxt);
+ (void) til_module_create_context(ctxt->snow_channel.module, stream, rand_r(&seed), ticks, 0, path, NULL, &ctxt->snow_channel.module_ctxt);
}
for (size_t i = 0; i < n_modules; i++) {
@@ -268,7 +268,7 @@ static void rtv_destroy_context(til_module_context_t *context)
}
-static void rtv_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void rtv_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
rtv_context_t *ctxt = (rtv_context_t *)context;
time_t now = time(NULL);
@@ -279,11 +279,11 @@ static void rtv_render_fragment(til_module_context_t *context, unsigned ticks, u
if (now >= ctxt->next_hide_caption)
ctxt->caption = NULL;
- til_module_render(ctxt->channel->module_ctxt, ticks, fragment_ptr);
+ til_module_render(ctxt->channel->module_ctxt, stream, ticks, fragment_ptr);
}
-static void rtv_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr)
+static void rtv_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr)
{
rtv_context_t *ctxt = (rtv_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/shapes/shapes.c b/src/modules/shapes/shapes.c
index 65a13fa..1be9f03 100644
--- a/src/modules/shapes/shapes.c
+++ b/src/modules/shapes/shapes.c
@@ -98,14 +98,14 @@ static shapes_setup_t shapes_default_setup = {
};
-static til_module_context_t * shapes_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * shapes_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
shapes_context_t *ctxt;
if (!setup)
setup = &shapes_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(shapes_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(shapes_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -115,7 +115,7 @@ static til_module_context_t * shapes_create_context(unsigned seed, unsigned tick
}
-static void shapes_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void shapes_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
shapes_context_t *ctxt = (shapes_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c
index 9a86689..bcf1cc4 100644
--- a/src/modules/snow/snow.c
+++ b/src/modules/snow/snow.c
@@ -22,11 +22,11 @@ typedef struct snow_context_t {
} snow_context_t;
-static til_module_context_t * snow_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * snow_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
snow_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(snow_context_t) + n_cpus * sizeof(snow_seed_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(snow_context_t) + n_cpus * sizeof(snow_seed_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -37,13 +37,13 @@ static til_module_context_t * snow_create_context(unsigned seed, unsigned ticks,
}
-static void snow_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void snow_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
*res_frame_plan = (til_frame_plan_t){ .fragmenter = til_fragmenter_slice_per_cpu };
}
-static void snow_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void snow_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
snow_context_t *ctxt = (snow_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c
index 1a2c8bb..afe4f0f 100644
--- a/src/modules/sparkler/sparkler.c
+++ b/src/modules/sparkler/sparkler.c
@@ -35,14 +35,14 @@ extern particle_ops_t simple_ops;
static sparkler_setup_t sparkler_default_setup;
-static til_module_context_t * sparkler_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * sparkler_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
sparkler_context_t *ctxt;
if (!setup)
setup = &sparkler_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(sparkler_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(sparkler_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -75,7 +75,7 @@ static void sparkler_destroy_context(til_module_context_t *context)
}
-static void sparkler_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void sparkler_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
sparkler_context_t *ctxt = (sparkler_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -92,7 +92,7 @@ static void sparkler_prepare_frame(til_module_context_t *context, unsigned ticks
/* Render a 3D particle system */
-static void sparkler_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void sparkler_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
sparkler_context_t *ctxt = (sparkler_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/spiro/spiro.c b/src/modules/spiro/spiro.c
index 236dd4a..ab11aab 100644
--- a/src/modules/spiro/spiro.c
+++ b/src/modules/spiro/spiro.c
@@ -31,12 +31,12 @@ typedef struct spiro_context_t {
} spiro_context_t;
-static til_module_context_t * spiro_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * spiro_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
spiro_context_t *ctxt;
float z;
- ctxt = til_module_context_new(sizeof(spiro_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(spiro_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -53,7 +53,7 @@ static til_module_context_t * spiro_create_context(unsigned seed, unsigned ticks
return &ctxt->til_module_context;
}
-static void spiro_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void spiro_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
spiro_context_t *ctxt = (spiro_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c
index 82619d7..26f2913 100644
--- a/src/modules/stars/stars.c
+++ b/src/modules/stars/stars.c
@@ -70,7 +70,7 @@ float get_random_unit_coord(unsigned *seed) {
}
-static til_module_context_t * stars_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * stars_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
stars_context_t *ctxt;
float z;
@@ -79,7 +79,7 @@ static til_module_context_t * stars_create_context(unsigned seed, unsigned ticks
if (!setup)
setup = &stars_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(stars_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(stars_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -131,7 +131,7 @@ static void stars_destroy_context(til_module_context_t *context)
}
-static void stars_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void stars_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
stars_context_t *ctxt = (stars_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -223,10 +223,10 @@ static void stars_render_fragment(til_module_context_t *context, unsigned ticks,
ctxt->points = tmp_ptr;
}
- if (!til_stream_tap_context(fragment->stream, context, &ctxt->taps.rot_angle))
+ if (!til_stream_tap_context(stream, context, &ctxt->taps.rot_angle))
*ctxt->rot_angle+=*ctxt->rot_rate;
- if (!til_stream_tap_context(fragment->stream, context, &ctxt->taps.rot_rate)) {
+ if (!til_stream_tap_context(stream, context, &ctxt->taps.rot_rate)) {
// handle rotation parameters
if(*ctxt->rot_angle>M_PI_4)
*ctxt->rot_rate=*ctxt->rot_rate-ctxt->rot_adj;
@@ -235,16 +235,16 @@ static void stars_render_fragment(til_module_context_t *context, unsigned ticks,
}
/* there's no automation of offset_angle */
- (void) til_stream_tap_context(fragment->stream, context, &ctxt->taps.offset_angle);
+ (void) til_stream_tap_context(stream, context, &ctxt->taps.offset_angle);
// handle offset parameters
- if (!til_stream_tap_context(fragment->stream, context, &ctxt->taps.offset_x)) {
+ if (!til_stream_tap_context(stream, context, &ctxt->taps.offset_x)) {
float tmp_x = (*ctxt->offset_x*cosf(*ctxt->offset_angle))-
(*ctxt->offset_y*sinf(*ctxt->offset_angle));
*ctxt->offset_x = tmp_x;
}
- if (!til_stream_tap_context(fragment->stream, context, &ctxt->taps.offset_y)) {
+ if (!til_stream_tap_context(stream, context, &ctxt->taps.offset_y)) {
float tmp_y = (*ctxt->offset_x*sinf(*ctxt->offset_angle))+
(*ctxt->offset_y*cosf(*ctxt->offset_angle));
*ctxt->offset_y = tmp_y;
diff --git a/src/modules/strobe/strobe.c b/src/modules/strobe/strobe.c
index bc0c365..5410ffb 100644
--- a/src/modules/strobe/strobe.c
+++ b/src/modules/strobe/strobe.c
@@ -40,14 +40,14 @@ static strobe_setup_t strobe_default_setup = {
};
-static til_module_context_t * strobe_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * strobe_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
strobe_context_t *ctxt;
if (!setup)
setup = &strobe_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(strobe_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(strobe_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -58,7 +58,7 @@ static til_module_context_t * strobe_create_context(unsigned seed, unsigned tick
}
-static void strobe_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void strobe_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
strobe_context_t *ctxt = (strobe_context_t *)context;
@@ -73,7 +73,7 @@ static void strobe_prepare_frame(til_module_context_t *context, unsigned ticks,
}
-static void strobe_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void strobe_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
strobe_context_t *ctxt = (strobe_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -85,7 +85,7 @@ static void strobe_render_fragment(til_module_context_t *context, unsigned ticks
}
-static void strobe_finish_frame(til_module_context_t *context, unsigned int ticks, til_fb_fragment_t **fragment_ptr)
+static void strobe_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned int ticks, til_fb_fragment_t **fragment_ptr)
{
strobe_context_t *ctxt = (strobe_context_t *)context;
diff --git a/src/modules/submit/submit.c b/src/modules/submit/submit.c
index f46a205..b3c7220 100644
--- a/src/modules/submit/submit.c
+++ b/src/modules/submit/submit.c
@@ -267,14 +267,14 @@ static void setup_grid(submit_context_t *ctxt)
}
-static til_module_context_t * submit_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * submit_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
submit_context_t *ctxt;
if (!setup)
setup = &submit_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(submit_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(submit_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -294,7 +294,7 @@ static void submit_destroy_context(til_module_context_t *context)
}
-static void submit_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void submit_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
submit_context_t *ctxt = (submit_context_t *)context;
@@ -317,7 +317,7 @@ static void submit_prepare_frame(til_module_context_t *context, unsigned ticks,
}
-static void submit_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void submit_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
submit_context_t *ctxt = (submit_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/swab/swab.c b/src/modules/swab/swab.c
index b7ccf9d..0465de7 100644
--- a/src/modules/swab/swab.c
+++ b/src/modules/swab/swab.c
@@ -66,11 +66,11 @@ static inline uint32_t color_to_uint32(color_t color) {
}
-static til_module_context_t * swab_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * swab_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
swab_context_t *ctxt;
- ctxt = til_module_context_new(sizeof(swab_context_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(swab_context_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -93,7 +93,7 @@ static void swab_destroy_context(til_module_context_t *context)
}
-static void swab_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void swab_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
swab_context_t *ctxt = (swab_context_t *)context;
@@ -103,7 +103,7 @@ static void swab_prepare_frame(til_module_context_t *context, unsigned ticks, ti
}
-static void swab_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void swab_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
swab_context_t *ctxt = (swab_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c
index 48b70aa..5a58210 100644
--- a/src/modules/swarm/swarm.c
+++ b/src/modules/swarm/swarm.c
@@ -181,14 +181,14 @@ static inline uint32_t color_to_uint32(v3f_t color) {
}
-static til_module_context_t * swarm_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * swarm_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
swarm_context_t *ctxt;
if (!setup)
setup = &swarm_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(swarm_context_t) + sizeof(*(ctxt->boids)) * SWARM_SIZE, seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(swarm_context_t) + sizeof(*(ctxt->boids)) * SWARM_SIZE, seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -401,7 +401,7 @@ static void swarm_draw_as_lines(swarm_context_t *ctxt, til_fb_fragment_t *fragme
}
-static void swarm_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void swarm_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
swarm_context_t *ctxt = (swarm_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
diff --git a/src/modules/voronoi/voronoi.c b/src/modules/voronoi/voronoi.c
index bf82ca3..647871b 100644
--- a/src/modules/voronoi/voronoi.c
+++ b/src/modules/voronoi/voronoi.c
@@ -80,14 +80,14 @@ static void voronoi_randomize(voronoi_context_t *ctxt)
}
-static til_module_context_t * voronoi_create_context(unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
+static til_module_context_t * voronoi_create_context(til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, char *path, til_setup_t *setup)
{
voronoi_context_t *ctxt;
if (!setup)
setup = &voronoi_default_setup.til_setup;
- ctxt = til_module_context_new(sizeof(voronoi_context_t) + ((voronoi_setup_t *)setup)->n_cells * sizeof(voronoi_cell_t), seed, ticks, n_cpus, path);
+ ctxt = til_module_context_new(stream, sizeof(voronoi_context_t) + ((voronoi_setup_t *)setup)->n_cells * sizeof(voronoi_cell_t), seed, ticks, n_cpus, path);
if (!ctxt)
return NULL;
@@ -281,7 +281,7 @@ static void voronoi_sample_colors(voronoi_context_t *ctxt, til_fb_fragment_t *fr
}
-static void voronoi_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
+static void voronoi_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan)
{
voronoi_context_t *ctxt = (voronoi_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
@@ -315,7 +315,7 @@ static void voronoi_prepare_frame(til_module_context_t *context, unsigned ticks,
}
-static void voronoi_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
+static void voronoi_render_fragment(til_module_context_t *context, til_stream_t *stream, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr)
{
voronoi_context_t *ctxt = (voronoi_context_t *)context;
til_fb_fragment_t *fragment = *fragment_ptr;
© All Rights Reserved