diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-09-05 22:30:10 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-09-05 22:44:13 -0700 |
commit | 237d717f0989e9e3adc51b0088d07db9b8cac6d6 (patch) | |
tree | 7991d7d25cb76be76143533208ddbd0cec5d3160 | |
parent | 3dc6f1f6eecb9e8f0e91454faf4fe00c61d35dd9 (diff) |
modules/blinds: use til_ticks_to_rads(ticks)
This gets rid of the static accumulator hack used for the blinds
phase.
-rw-r--r-- | src/modules/blinds/blinds.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; } |