summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/plato/plato.c5
-rw-r--r--src/modules/roto/roto.c6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c
index f43eda3..a20137e 100644
--- a/src/modules/plato/plato.c
+++ b/src/modules/plato/plato.c
@@ -658,9 +658,8 @@ static void plato_render_fragment(til_module_context_t *context, til_stream_t *s
(void) til_stream_tap_context(stream, context, NULL, &ctxt->taps.orbit_rate);
(void) til_stream_tap_context(stream, context, NULL, &ctxt->taps.spin_rate);
- ctxt->r += (float)(ticks - context->ticks) * (*ctxt->orbit_rate * .001f);
- ctxt->rr += (float)(ticks - context->ticks) * (*ctxt->spin_rate * .001f);
- context->ticks = ticks;
+ ctxt->r += (float)(ticks - context->last_ticks) * (*ctxt->orbit_rate * .001f);
+ ctxt->rr += (float)(ticks - context->last_ticks) * (*ctxt->spin_rate * .001f);
til_fb_fragment_clear(fragment);
for (int i = 0; i < sizeof(polyhedra) / sizeof(*polyhedra); i++) {
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index 8564870..28e27e1 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -189,9 +189,9 @@ static void roto_prepare_frame(til_module_context_t *context, til_stream_t *stre
*res_frame_plan = (til_frame_plan_t){ .fragmenter = til_fragmenter_slice_per_cpu };
// This governs the rotation and color cycle.
- if (ticks != context->ticks) {
+ if (ticks != context->last_ticks) {
ctxt->r += FIXED_TO_INT(FIXED_MULT(FIXED_SIN(ctxt->rr), FIXED_NEW(16)));
- ctxt->rr += (ticks - context->ticks) >> 2;
+ ctxt->rr += (ticks - context->last_ticks) >> 2;
/* Vary the colors, this is just a mashup of sinusoidal rgb values. */
ctxt->palette[0].r = (FIXED_MULT(FIXED_COS(ctxt->rr), FIXED_NEW(127)) + FIXED_NEW(128));
@@ -201,8 +201,6 @@ static void roto_prepare_frame(til_module_context_t *context, til_stream_t *stre
ctxt->palette[1].r = (FIXED_MULT(FIXED_SIN(ctxt->rr / 2), FIXED_NEW(127)) + FIXED_NEW(128));
ctxt->palette[1].g = (FIXED_MULT(FIXED_COS(ctxt->rr / 2), FIXED_NEW(127)) + FIXED_NEW(128));
ctxt->palette[1].b = (FIXED_MULT(FIXED_SIN(ctxt->rr), FIXED_NEW(127)) + FIXED_NEW(128));
-
- context->ticks = ticks;
}
}
© All Rights Reserved