Posted: Sun Dec 05, 2010 11:24 am
GetTime(), to my knowledge, will return system time in milliseconds.
From the looks of it, m_index is used with m_psurfaces to choose the right image.
Time multiplied by number of images, then with the % (Modulo) the remainder of (time*count)/count
I never was good at math, maybe you can make sense of what that actually does... I'm gonna sleep on it, it's late
Code: Select all
void AnimatedImage::Evaluate()
{
float time = GetTime()->GetValue();
int count = m_psurfaces.GetCount();
m_index = (int)(time * count) % count;
Image::Evaluate();
}Time multiplied by number of images, then with the % (Modulo) the remainder of (time*count)/count
I never was good at math, maybe you can make sense of what that actually does... I'm gonna sleep on it, it's late