summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-06-09 22:47:07 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-06-10 21:17:29 -0700
commit599a0896f57718f907f48684e10040b5a1d5ffd0 (patch)
tree00327456c6b99d3f77ee243e5d0e7d8ac7c08778 /src/modules
parentb437600c820f489049c022d2c4697226cf8d68fc (diff)
modules/plato: derive movement from delta ticks
This way if a given context gets rendered repeatedly for the same tick, no movement occurs, until ticks changes.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/plato/plato.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c
index ffa7e68..3aa89fa 100644
--- a/src/modules/plato/plato.c
+++ b/src/modules/plato/plato.c
@@ -626,7 +626,8 @@ static void plato_render_fragment(til_module_context_t *context, unsigned ticks,
{
plato_context_t *ctxt = (plato_context_t *)context;
- ctxt->r += .015f;
+ ctxt->r += (float)(ticks - context->ticks) * .001f;
+ context->ticks = ticks;
til_fb_fragment_clear(fragment);
for (int i = 0; i < sizeof(polyhedra) / sizeof(*polyhedra); i++) {
© All Rights Reserved