summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/blinds/blinds.c29
-rw-r--r--src/modules/checkers/checkers.c31
-rw-r--r--src/modules/compose/compose.c2
-rw-r--r--src/modules/drizzle/drizzle.c33
-rw-r--r--src/modules/flui2d/flui2d.c27
-rw-r--r--src/modules/mixer/mixer.c31
-rw-r--r--src/modules/moire/moire.c29
-rw-r--r--src/modules/montage/montage.c2
-rw-r--r--src/modules/pixbounce/pixbounce.c24
-rw-r--r--src/modules/plato/plato.c27
-rw-r--r--src/modules/rkt/rkt.c27
-rw-r--r--src/modules/roto/roto.c29
-rw-r--r--src/modules/rtv/rtv.c2
-rw-r--r--src/modules/shapes/shapes.c33
-rw-r--r--src/modules/sparkler/sparkler.c29
-rw-r--r--src/modules/stars/stars.c26
-rw-r--r--src/modules/strobe/strobe.c31
-rw-r--r--src/modules/submit/submit.c29
-rw-r--r--src/modules/swarm/swarm.c27
-rw-r--r--src/modules/voronoi/voronoi.c33
20 files changed, 275 insertions, 226 deletions
diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c
index 8ffd596..68a387c 100644
--- a/src/modules/blinds/blinds.c
+++ b/src/modules/blinds/blinds.c
@@ -171,6 +171,21 @@ static void blinds_render_fragment(til_module_context_t *context, til_stream_t *
}
+static int blinds_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t blinds_module = {
+ .create_context = blinds_create_context,
+ .prepare_frame = blinds_prepare_frame,
+ .render_fragment = blinds_render_fragment,
+ .setup = blinds_setup,
+ .name = "blinds",
+ .description = "Retro 80s-inspired window blinds (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int blinds_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *orientation;
@@ -225,7 +240,7 @@ static int blinds_setup(const til_settings_t *settings, til_setting_t **res_sett
if (res_setup) {
blinds_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &blinds_module);
if (!setup)
return -ENOMEM;
@@ -246,15 +261,3 @@ static int blinds_setup(const til_settings_t *settings, til_setting_t **res_sett
return 0;
}
-
-
-til_module_t blinds_module = {
- .create_context = blinds_create_context,
- .prepare_frame = blinds_prepare_frame,
- .render_fragment = blinds_render_fragment,
- .setup = blinds_setup,
- .name = "blinds",
- .description = "Retro 80s-inspired window blinds (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/checkers/checkers.c b/src/modules/checkers/checkers.c
index d6530eb..a33a922 100644
--- a/src/modules/checkers/checkers.c
+++ b/src/modules/checkers/checkers.c
@@ -486,6 +486,22 @@ static int checkers_value_to_pos(const char **options, const char *value, unsign
}
+static int checkers_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t checkers_module = {
+ .create_context = checkers_create_context,
+ .destroy_context = checkers_destroy_context,
+ .prepare_frame = checkers_prepare_frame,
+ .render_fragment = checkers_render_fragment,
+ .setup = checkers_setup,
+ .name = "checkers",
+ .description = "Checker-patterned overlay (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int checkers_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *size;
@@ -749,7 +765,7 @@ static int checkers_setup(const til_settings_t *settings, til_setting_t **res_se
if (res_setup) {
checkers_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), checkers_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup), checkers_setup_free, &checkers_module);
if (!setup)
return -ENOMEM;
@@ -825,16 +841,3 @@ static int checkers_setup(const til_settings_t *settings, til_setting_t **res_se
return 0;
}
-
-
-til_module_t checkers_module = {
- .create_context = checkers_create_context,
- .destroy_context = checkers_destroy_context,
- .prepare_frame = checkers_prepare_frame,
- .render_fragment = checkers_render_fragment,
- .setup = checkers_setup,
- .name = "checkers",
- .description = "Checker-patterned overlay (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index 5a10113..5420cc3 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -409,7 +409,7 @@ static int compose_setup(const til_settings_t *settings, til_setting_t **res_set
til_setting_t *layer_setting;
compose_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup) + n_layers * sizeof(*setup->layers), compose_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup) + n_layers * sizeof(*setup->layers), compose_setup_free, &compose_module);
if (!setup)
return -ENOMEM;
diff --git a/src/modules/drizzle/drizzle.c b/src/modules/drizzle/drizzle.c
index d85d904..9ca58f7 100644
--- a/src/modules/drizzle/drizzle.c
+++ b/src/modules/drizzle/drizzle.c
@@ -350,6 +350,23 @@ static void drizzle_finish_frame(til_module_context_t *context, til_stream_t *st
}
+static int drizzle_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t drizzle_module = {
+ .create_context = drizzle_create_context,
+ .destroy_context = drizzle_destroy_context,
+ .prepare_frame = drizzle_prepare_frame,
+ .render_fragment = drizzle_render_fragment,
+ .finish_frame = drizzle_finish_frame,
+ .name = "drizzle",
+ .description = "Classic 2D rain effect (threaded (poorly))",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .setup = drizzle_setup,
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int drizzle_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *viscosity;
@@ -402,7 +419,7 @@ static int drizzle_setup(const til_settings_t *settings, til_setting_t **res_set
drizzle_setup_t *setup;
int i;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &drizzle_module);
if (!setup)
return -ENOMEM;
@@ -424,17 +441,3 @@ static int drizzle_setup(const til_settings_t *settings, til_setting_t **res_set
return 0;
}
-
-
-til_module_t drizzle_module = {
- .create_context = drizzle_create_context,
- .destroy_context = drizzle_destroy_context,
- .prepare_frame = drizzle_prepare_frame,
- .render_fragment = drizzle_render_fragment,
- .finish_frame = drizzle_finish_frame,
- .name = "drizzle",
- .description = "Classic 2D rain effect (threaded (poorly))",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .setup = drizzle_setup,
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/flui2d/flui2d.c b/src/modules/flui2d/flui2d.c
index 147bb32..bfa36fb 100644
--- a/src/modules/flui2d/flui2d.c
+++ b/src/modules/flui2d/flui2d.c
@@ -398,6 +398,20 @@ static void flui2d_render_fragment(til_module_context_t *context, til_stream_t *
}
+static int flui2d_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t flui2d_module = {
+ .create_context = flui2d_create_context,
+ .prepare_frame = flui2d_prepare_frame,
+ .render_fragment = flui2d_render_fragment,
+ .setup = flui2d_setup,
+ .name = "flui2d",
+ .description = "Fluid dynamics simulation in 2D (threaded (poorly))",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+};
+
+
/* Settings hooks for configurable variables */
static int flui2d_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
@@ -523,7 +537,7 @@ static int flui2d_setup(const til_settings_t *settings, til_setting_t **res_sett
if (res_setup) {
flui2d_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &flui2d_module);
if (!setup)
return -ENOMEM;
@@ -554,14 +568,3 @@ static int flui2d_setup(const til_settings_t *settings, til_setting_t **res_sett
return 0;
}
-
-
-til_module_t flui2d_module = {
- .create_context = flui2d_create_context,
- .prepare_frame = flui2d_prepare_frame,
- .render_fragment = flui2d_render_fragment,
- .setup = flui2d_setup,
- .name = "flui2d",
- .description = "Fluid dynamics simulation in 2D (threaded (poorly))",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
-};
diff --git a/src/modules/mixer/mixer.c b/src/modules/mixer/mixer.c
index b9e4bfd..b3559c1 100644
--- a/src/modules/mixer/mixer.c
+++ b/src/modules/mixer/mixer.c
@@ -299,6 +299,22 @@ static void mixer_setup_free(til_setup_t *setup)
}
+static int mixer_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t mixer_module = {
+ .create_context = mixer_create_context,
+ .destroy_context = mixer_destroy_context,
+ .prepare_frame = mixer_prepare_frame,
+ .render_fragment = mixer_render_fragment,
+ .finish_frame = mixer_finish_frame,
+ .name = "mixer",
+ .description = "Module blender",
+ .setup = mixer_setup,
+ .flags = TIL_MODULE_EXPERIMENTAL,
+};
+
+
static int mixer_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *style_values[] = {
@@ -387,7 +403,7 @@ static int mixer_setup(const til_settings_t *settings, til_setting_t **res_setti
if (res_setup) {
mixer_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), mixer_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup), mixer_setup_free, &mixer_module);
if (!setup)
return -ENOMEM;
@@ -427,16 +443,3 @@ static int mixer_setup(const til_settings_t *settings, til_setting_t **res_setti
return 0;
}
-
-
-til_module_t mixer_module = {
- .create_context = mixer_create_context,
- .destroy_context = mixer_destroy_context,
- .prepare_frame = mixer_prepare_frame,
- .render_fragment = mixer_render_fragment,
- .finish_frame = mixer_finish_frame,
- .name = "mixer",
- .description = "Module blender",
- .setup = mixer_setup,
- .flags = TIL_MODULE_EXPERIMENTAL,
-};
diff --git a/src/modules/moire/moire.c b/src/modules/moire/moire.c
index 853b106..9924a10 100644
--- a/src/modules/moire/moire.c
+++ b/src/modules/moire/moire.c
@@ -113,6 +113,21 @@ static void moire_render_fragment(til_module_context_t *context, til_stream_t *s
}
+static int moire_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t moire_module = {
+ .create_context = moire_create_context,
+ .prepare_frame = moire_prepare_frame,
+ .render_fragment = moire_render_fragment,
+ .setup = moire_setup,
+ .name = "moire",
+ .description = "2D Moire interference patterns (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int moire_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *centers;
@@ -143,7 +158,7 @@ static int moire_setup(const til_settings_t *settings, til_setting_t **res_setti
if (res_setup) {
moire_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &moire_module);
if (!setup)
return -ENOMEM;
@@ -154,15 +169,3 @@ static int moire_setup(const til_settings_t *settings, til_setting_t **res_setti
return 0;
}
-
-
-til_module_t moire_module = {
- .create_context = moire_create_context,
- .prepare_frame = moire_prepare_frame,
- .render_fragment = moire_render_fragment,
- .setup = moire_setup,
- .name = "moire",
- .description = "2D Moire interference patterns (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c
index 8efeec1..9864520 100644
--- a/src/modules/montage/montage.c
+++ b/src/modules/montage/montage.c
@@ -307,7 +307,7 @@ static int montage_setup(const til_settings_t *settings, til_setting_t **res_set
til_setting_t *tile_setting;
montage_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup) + n_tiles * sizeof(*setup->tiles), montage_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup) + n_tiles * sizeof(*setup->tiles), montage_setup_free, &montage_module);
if (!setup)
return -ENOMEM;
diff --git a/src/modules/pixbounce/pixbounce.c b/src/modules/pixbounce/pixbounce.c
index fcc3c5b..7dfceaf 100644
--- a/src/modules/pixbounce/pixbounce.c
+++ b/src/modules/pixbounce/pixbounce.c
@@ -315,6 +315,18 @@ static void pixbounce_render_fragment(til_module_context_t *context, til_stream_
ctxt->y = ctxt->y+ctxt->y_dir;
}
+int pixbounce_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+til_module_t pixbounce_module = {
+ .create_context = pixbounce_create_context,
+ .render_fragment = pixbounce_render_fragment,
+ .setup = pixbounce_setup,
+ .name = "pixbounce",
+ .description = "Pixmap bounce",
+ .author = "Philip J Freeman <elektron@halo.nu>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
int pixbounce_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *pixmap_size;
@@ -374,7 +386,7 @@ int pixbounce_setup(const til_settings_t *settings, til_setting_t **res_setting,
if (res_setup) {
pixbounce_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &pixbounce_module);
if (!setup)
return -ENOMEM;
@@ -405,13 +417,3 @@ int pixbounce_setup(const til_settings_t *settings, til_setting_t **res_setting,
return 0;
}
-
-til_module_t pixbounce_module = {
- .create_context = pixbounce_create_context,
- .render_fragment = pixbounce_render_fragment,
- .setup = pixbounce_setup,
- .name = "pixbounce",
- .description = "Pixmap bounce",
- .author = "Philip J Freeman <elektron@halo.nu>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c
index a20137e..89661c3 100644
--- a/src/modules/plato/plato.c
+++ b/src/modules/plato/plato.c
@@ -691,6 +691,20 @@ static void plato_render_fragment(til_module_context_t *context, til_stream_t *s
}
+static int plato_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t plato_module = {
+ .create_context = plato_create_context,
+ .render_fragment = plato_render_fragment,
+ .setup = plato_setup,
+ .name = "plato",
+ .description = "Platonic solids rendered in 3D",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int plato_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *orbit_rate;
@@ -744,7 +758,7 @@ static int plato_setup(const til_settings_t *settings, til_setting_t **res_setti
if (res_setup) {
plato_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &plato_module);
if (!setup)
return -ENOMEM;
@@ -756,14 +770,3 @@ static int plato_setup(const til_settings_t *settings, til_setting_t **res_setti
return 0;
}
-
-
-til_module_t plato_module = {
- .create_context = plato_create_context,
- .render_fragment = plato_render_fragment,
- .setup = plato_setup,
- .name = "plato",
- .description = "Platonic solids rendered in 3D",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c
index f5f73e7..45073ef 100644
--- a/src/modules/rkt/rkt.c
+++ b/src/modules/rkt/rkt.c
@@ -397,6 +397,20 @@ int rkt_scene_module_setup(const til_settings_t *settings, til_setting_t **res_s
}
+static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t rkt_module = {
+ .create_context = rkt_create_context,
+ .destroy_context = rkt_destroy_context,
+ .render_fragment = rkt_render_fragment,
+ .name = "rkt",
+ .description = "GNU Rocket module sequencer",
+ .setup = rkt_setup,
+ .flags = TIL_MODULE_HERMETIC, /* this needs refinement esp. if rkt gets split into a player and editor */
+};
+
+
static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const til_settings_t *scenes_settings;
@@ -596,7 +610,7 @@ static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting
rkt_setup_t *setup;
unsigned ibpm, irpb;
- setup = til_setup_new(settings, sizeof(*setup) + n_scenes * sizeof(*setup->scenes), rkt_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup) + n_scenes * sizeof(*setup->scenes), rkt_setup_free, &rkt_module);
if (!setup)
return -ENOMEM;
@@ -683,14 +697,3 @@ static int rkt_setup(const til_settings_t *settings, til_setting_t **res_setting
return 0;
}
-
-
-til_module_t rkt_module = {
- .create_context = rkt_create_context,
- .destroy_context = rkt_destroy_context,
- .render_fragment = rkt_render_fragment,
- .name = "rkt",
- .description = "GNU Rocket module sequencer",
- .setup = rkt_setup,
- .flags = TIL_MODULE_HERMETIC, /* this needs refinement esp. if rkt gets split into a player and editor */
-};
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index 8c9dd99..d60629c 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -419,6 +419,21 @@ static void roto_setup_free(til_setup_t *setup)
}
+static int roto_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t roto_module = {
+ .create_context = roto_create_context,
+ .destroy_context = roto_destroy_context,
+ .prepare_frame = roto_prepare_frame,
+ .render_fragment = roto_render_fragment,
+ .setup = roto_setup,
+ .name = "roto",
+ .description = "Anti-aliased tiled texture rotation (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+};
+
+
static int roto_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *fill_module, *fill_module_name;
@@ -497,7 +512,7 @@ static int roto_setup(const til_settings_t *settings, til_setting_t **res_settin
if (res_setup) {
roto_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), roto_setup_free);
+ setup = til_setup_new(settings, sizeof(*setup), roto_setup_free, &roto_module);
if (!setup)
return -ENOMEM;
@@ -520,15 +535,3 @@ static int roto_setup(const til_settings_t *settings, til_setting_t **res_settin
return 0;
}
-
-
-til_module_t roto_module = {
- .create_context = roto_create_context,
- .destroy_context = roto_destroy_context,
- .prepare_frame = roto_prepare_frame,
- .render_fragment = roto_render_fragment,
- .setup = roto_setup,
- .name = "roto",
- .description = "Anti-aliased tiled texture rotation (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
-};
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 445be0f..a9e8678 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -520,7 +520,7 @@ static int rtv_setup(const til_settings_t *settings, til_setting_t **res_setting
rtv_setup_t *setup;
/* FIXME: rtv_setup_t.snow_module needs freeing, so we need a bespoke free_func */
- setup = til_setup_new(settings, sizeof(*setup) + sizeof(setup->channels[0]), NULL);
+ setup = til_setup_new(settings, sizeof(*setup) + sizeof(setup->channels[0]), NULL, &rtv_module);
if (!setup)
return -ENOMEM;
diff --git a/src/modules/shapes/shapes.c b/src/modules/shapes/shapes.c
index 56ad35a..e96d806 100644
--- a/src/modules/shapes/shapes.c
+++ b/src/modules/shapes/shapes.c
@@ -476,6 +476,23 @@ static void shapes_finish_frame(til_module_context_t *context, til_stream_t *str
}
+static int shapes_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t shapes_module = {
+ .create_context = shapes_create_context,
+ .destroy_context = shapes_destroy_context,
+ .prepare_frame = shapes_prepare_frame,
+ .render_fragment = shapes_render_fragment,
+ .finish_frame = shapes_finish_frame,
+ .setup = shapes_setup,
+ .name = "shapes",
+ .description = "Procedural 2D shapes (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int shapes_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *type;
@@ -684,7 +701,7 @@ static int shapes_setup(const til_settings_t *settings, til_setting_t **res_sett
shapes_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &shapes_module);
if (!setup)
return -ENOMEM;
@@ -717,17 +734,3 @@ static int shapes_setup(const til_settings_t *settings, til_setting_t **res_sett
return 0;
}
-
-
-til_module_t shapes_module = {
- .create_context = shapes_create_context,
- .destroy_context = shapes_destroy_context,
- .prepare_frame = shapes_prepare_frame,
- .render_fragment = shapes_render_fragment,
- .finish_frame = shapes_finish_frame,
- .setup = shapes_setup,
- .name = "shapes",
- .description = "Procedural 2D shapes (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c
index 8cd1bf9..1e7e171 100644
--- a/src/modules/sparkler/sparkler.c
+++ b/src/modules/sparkler/sparkler.c
@@ -99,6 +99,21 @@ static void sparkler_render_fragment(til_module_context_t *context, til_stream_t
}
+static int sparkler_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t sparkler_module = {
+ .create_context = sparkler_create_context,
+ .destroy_context = sparkler_destroy_context,
+ .prepare_frame = sparkler_prepare_frame,
+ .render_fragment = sparkler_render_fragment,
+ .setup = sparkler_setup,
+ .name = "sparkler",
+ .description = "Particle system with spatial interactions (threaded (poorly))",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+};
+
+
/* Settings hooks for configurable variables */
static int sparkler_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
@@ -184,7 +199,7 @@ static int sparkler_setup(const til_settings_t *settings, til_setting_t **res_se
if (res_setup) {
sparkler_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &sparkler_module);
if (!setup)
return -ENOMEM;
@@ -206,15 +221,3 @@ static int sparkler_setup(const til_settings_t *settings, til_setting_t **res_se
return 0;
}
-
-
-til_module_t sparkler_module = {
- .create_context = sparkler_create_context,
- .destroy_context = sparkler_destroy_context,
- .prepare_frame = sparkler_prepare_frame,
- .render_fragment = sparkler_render_fragment,
- .setup = sparkler_setup,
- .name = "sparkler",
- .description = "Particle system with spatial interactions (threaded (poorly))",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
-};
diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c
index 4e0b4fd..fff6792 100644
--- a/src/modules/stars/stars.c
+++ b/src/modules/stars/stars.c
@@ -248,6 +248,19 @@ static void stars_render_fragment(til_module_context_t *context, til_stream_t *s
}
}
+int stars_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+til_module_t stars_module = {
+ .create_context = stars_create_context,
+ .destroy_context = stars_destroy_context,
+ .render_fragment = stars_render_fragment,
+ .setup = stars_setup,
+ .name = "stars",
+ .description = "Basic starfield",
+ .author = "Philip J Freeman <elektron@halo.nu>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
int stars_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *rot_adj;
@@ -280,7 +293,7 @@ int stars_setup(const til_settings_t *settings, til_setting_t **res_setting, con
if (res_setup) {
stars_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &stars_module);
if (!setup)
return -ENOMEM;
@@ -291,14 +304,3 @@ int stars_setup(const til_settings_t *settings, til_setting_t **res_setting, con
return 0;
}
-
-til_module_t stars_module = {
- .create_context = stars_create_context,
- .destroy_context = stars_destroy_context,
- .render_fragment = stars_render_fragment,
- .setup = stars_setup,
- .name = "stars",
- .description = "Basic starfield",
- .author = "Philip J Freeman <elektron@halo.nu>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/strobe/strobe.c b/src/modules/strobe/strobe.c
index 1ed0b8b..3b90c2d 100644
--- a/src/modules/strobe/strobe.c
+++ b/src/modules/strobe/strobe.c
@@ -89,6 +89,22 @@ static void strobe_finish_frame(til_module_context_t *context, til_stream_t *str
}
+static int strobe_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t strobe_module = {
+ .create_context = strobe_create_context,
+ .prepare_frame = strobe_prepare_frame,
+ .render_fragment = strobe_render_fragment,
+ .finish_frame = strobe_finish_frame,
+ .setup = strobe_setup,
+ .name = "strobe",
+ .description = "Strobe light (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int strobe_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *period;
@@ -123,7 +139,7 @@ static int strobe_setup(const til_settings_t *settings, til_setting_t **res_sett
if (res_setup) {
strobe_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &strobe_module);
if (!setup)
return -ENOMEM;
@@ -134,16 +150,3 @@ static int strobe_setup(const til_settings_t *settings, til_setting_t **res_sett
return 0;
}
-
-
-til_module_t strobe_module = {
- .create_context = strobe_create_context,
- .prepare_frame = strobe_prepare_frame,
- .render_fragment = strobe_render_fragment,
- .finish_frame = strobe_finish_frame,
- .setup = strobe_setup,
- .name = "strobe",
- .description = "Strobe light (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/submit/submit.c b/src/modules/submit/submit.c
index a3f7b25..4952d2d 100644
--- a/src/modules/submit/submit.c
+++ b/src/modules/submit/submit.c
@@ -324,6 +324,21 @@ static void submit_render_fragment(til_module_context_t *context, til_stream_t *
}
+static int submit_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t submit_module = {
+ .create_context = submit_create_context,
+ .destroy_context = submit_destroy_context,
+ .prepare_frame = submit_prepare_frame,
+ .render_fragment = submit_render_fragment,
+ .name = "submit",
+ .description = "Cellular automata conquest game sim (threaded (poorly))",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .setup = submit_setup,
+};
+
+
static int submit_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *values[] = {
@@ -352,7 +367,7 @@ static int submit_setup(const til_settings_t *settings, til_setting_t **res_sett
if (res_setup) {
submit_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &submit_module);
if (!setup)
return -ENOMEM;
@@ -364,15 +379,3 @@ static int submit_setup(const til_settings_t *settings, til_setting_t **res_sett
return 0;
}
-
-
-til_module_t submit_module = {
- .create_context = submit_create_context,
- .destroy_context = submit_destroy_context,
- .prepare_frame = submit_prepare_frame,
- .render_fragment = submit_render_fragment,
- .name = "submit",
- .description = "Cellular automata conquest game sim (threaded (poorly))",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .setup = submit_setup,
-};
diff --git a/src/modules/swarm/swarm.c b/src/modules/swarm/swarm.c
index 97a04d0..9407168 100644
--- a/src/modules/swarm/swarm.c
+++ b/src/modules/swarm/swarm.c
@@ -414,6 +414,20 @@ static void swarm_render_fragment(til_module_context_t *context, til_stream_t *s
}
+static int swarm_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t swarm_module = {
+ .create_context = swarm_create_context,
+ .render_fragment = swarm_render_fragment,
+ .setup = swarm_setup,
+ .name = "swarm",
+ .description = "\"Boids\"-inspired particle swarm in 3D",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int swarm_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *styles[] = {
@@ -441,7 +455,7 @@ static int swarm_setup(const til_settings_t *settings, til_setting_t **res_setti
if (res_setup) {
swarm_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &swarm_module);
if (!setup)
return -ENOMEM;
@@ -455,14 +469,3 @@ static int swarm_setup(const til_settings_t *settings, til_setting_t **res_setti
return 0;
}
-
-
-til_module_t swarm_module = {
- .create_context = swarm_create_context,
- .render_fragment = swarm_render_fragment,
- .setup = swarm_setup,
- .name = "swarm",
- .description = "\"Boids\"-inspired particle swarm in 3D",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
diff --git a/src/modules/voronoi/voronoi.c b/src/modules/voronoi/voronoi.c
index b2eff94..e4621ab 100644
--- a/src/modules/voronoi/voronoi.c
+++ b/src/modules/voronoi/voronoi.c
@@ -349,6 +349,23 @@ static void voronoi_finish_frame(til_module_context_t *context, til_stream_t *st
}
+static int voronoi_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup);
+
+
+til_module_t voronoi_module = {
+ .create_context = voronoi_create_context,
+ .destroy_context = voronoi_destroy_context,
+ .prepare_frame = voronoi_prepare_frame,
+ .render_fragment = voronoi_render_fragment,
+ .finish_frame = voronoi_finish_frame,
+ .setup = voronoi_setup,
+ .name = "voronoi",
+ .description = "Voronoi diagram (threaded)",
+ .author = "Vito Caputo <vcaputo@pengaru.com>",
+ .flags = TIL_MODULE_OVERLAYABLE,
+};
+
+
static int voronoi_setup(const til_settings_t *settings, til_setting_t **res_setting, const til_setting_desc_t **res_desc, til_setup_t **res_setup)
{
const char *n_cells;
@@ -403,7 +420,7 @@ static int voronoi_setup(const til_settings_t *settings, til_setting_t **res_set
if (res_setup) {
voronoi_setup_t *setup;
- setup = til_setup_new(settings, sizeof(*setup), NULL);
+ setup = til_setup_new(settings, sizeof(*setup), NULL, &voronoi_module);
if (!setup)
return -ENOMEM;
@@ -416,17 +433,3 @@ static int voronoi_setup(const til_settings_t *settings, til_setting_t **res_set
}
return 0;
}
-
-
-til_module_t voronoi_module = {
- .create_context = voronoi_create_context,
- .destroy_context = voronoi_destroy_context,
- .prepare_frame = voronoi_prepare_frame,
- .render_fragment = voronoi_render_fragment,
- .finish_frame = voronoi_finish_frame,
- .setup = voronoi_setup,
- .name = "voronoi",
- .description = "Voronoi diagram (threaded)",
- .author = "Vito Caputo <vcaputo@pengaru.com>",
- .flags = TIL_MODULE_OVERLAYABLE,
-};
© All Rights Reserved