diff --git a/animation.c b/animation.c index 23e401d..138dcd4 100644 --- a/animation.c +++ b/animation.c @@ -110,7 +110,8 @@ void animation_update( animation_state_t *state, const model_t *model, uint32_t dt_us) { state->elapsed_us += dt_us; - if (state->elapsed_us >= state->duration_us) { // Move to next keyframe + while (state->elapsed_us >= state->duration_us) { + assert(state->duration_us != 0); state->elapsed_us -= state->duration_us; state->current_keyframe = state->next_keyframe; load_keyframe(state, model);