Archived

This topic is now archived and is closed to further replies.

hagen

floats and updates serious problem

Recommended Posts

Ok, some of my update routines for frame cycling and movement update used DWORD comming out from a call to "LastTime - timeGetTime()"; but just today I changed all this routins to used FLOATs "(LastTime - timeGetTime())*0.001f) because I''m using another aproach for smooth movement. The problem is that for example: void CBaseSprite::CycleFrame(float* _pfElapsedTime) { if ( (*_pfElapsedTime) >= m_fAnimInterval) { if (FCurrentAnimation->Order == NULL) FFrameNbr++; ... As you can see, every time the elapsed time goes over the frame time interval, the frame is changed; however, when my program is in free running it takes years to change the FFrameNbr property, but if I''m going step by step things work OK. m_fAnimInterval its equal to 0.060f (60 ms), so I''m sure that I''m not comparing against incredible high values, as it looks on free-running. So, What is going on here!!!??????? /\ /__\ C.Z. Hagen

Share this post


Link to post
Share on other sites