diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-06-09 22:47:07 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-06-10 21:17:29 -0700 |
commit | 599a0896f57718f907f48684e10040b5a1d5ffd0 (patch) | |
tree | 00327456c6b99d3f77ee243e5d0e7d8ac7c08778 /src | |
parent | b437600c820f489049c022d2c4697226cf8d68fc (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')
-rw-r--r-- | src/modules/plato/plato.c | 3 |
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++) { |