From 237d717f0989e9e3adc51b0088d07db9b8cac6d6 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 5 Sep 2022 22:30:10 -0700 Subject: modules/blinds: use til_ticks_to_rads(ticks) This gets rid of the static accumulator hack used for the blinds phase. --- src/modules/blinds/blinds.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/modules/blinds/blinds.c b/src/modules/blinds/blinds.c index d3cddf2..d93a3c9 100644 --- a/src/modules/blinds/blinds.c +++ b/src/modules/blinds/blinds.c @@ -88,14 +88,12 @@ static void blinds_render_fragment(til_module_context_t *context, unsigned ticks blinds_context_t *ctxt = (blinds_context_t *)context; til_fb_fragment_t *fragment = *fragment_ptr; - static float rr; - + float r = til_ticks_to_rads(ticks); unsigned blind; - float r; til_fb_fragment_clear(fragment); - for (r = rr, blind = 0; blind < ctxt->setup.count; blind++, r += .1) { + for (blind = 0; blind < ctxt->setup.count; blind++, r += .1) { switch (ctxt->setup.orientation) { case BLINDS_ORIENTATION_HORIZONTAL: draw_blind_horizontal(fragment, blind, ctxt->setup.count, 1.f - fabsf(cosf(r))); @@ -105,8 +103,6 @@ static void blinds_render_fragment(til_module_context_t *context, unsigned ticks break; } } - - rr += .01; } -- cgit v1.2.3