EMI: Use uint instead of float for animation time.
EMI: Correctly wrap the animation time when the animation duration is exceeded. Fixes #987