This function is used to add an animation to the animator.
void dg_animator_update_sprite(dg_animator_t *animator, sfSprite *sprite, int time);
dg_animator_update_sprite(animator, sprite, dt);
void dg_animator_update_sprite(dg_animator_t *animator, sfSprite *sprite, int time)
{
if (animator && animator->length > animator->current) {
dg_animation_t *animation = animator->animations[animator->current];
dg_spritesheet_t *sheet = animation->sheet;
int frame = animation->frames[(int)(time % animation->size)];
dg_spritesheet_to_sprite(sheet, sprite, frame);
}
}