I have had several problems when using the
gdn_Animation class, It's possible that most or all of
them is due to my improper use (maybe?):
When defining an animation from file (*.ANM) - the
animation doesn't seem to be updating based on time
settings and frame definitions correctly.
The attached files are the (*.ANM) and (*.BMP) file
used for my testing purposes. Please verify that I am
or am not defining the animation file correctly.
** NOTE **
I've tried Both Animation types (NORMAL/REPEAT) with
similar results.
Animation Files for Logo Animation Test
Logged In: YES
user_id=82367
I've tried your .anm file and .bmp and it appears to work
ok. They animation file is correct.
The problem maybe when you draw the animation. You need to
pass in the time from the last time the animation was
updated.
gdn_Timer clock;
while ( window->Pump() == OK )
{
oldTime = clock.GetTime();
Animation.Draw(delta, 100,100);
manager->Flip();
delta = clock.GetTime() - oldTime;
}
Logged In: YES
user_id=152715
Ok, but your explanation doesn't make sense. I think the
animation class should keep track of the last time it was
told to draw. Not the outside program (ie: your while loop
example).
I'm sure you have a reason, but why are you requiring the
outside program to keep track of the time?
Regards,
Jumpster
Logged In: YES
user_id=82367
Right now the gdn_Animation stores how long it's been at
the current frame. When you call Draw(delta,...) it adds
that delta to the elapsed time and if it is greater then
the step time it moves onto the next frame.
A better option may be to add a gdn_Timer to the
gdn_Animation class so that all of the animation timing is
handled internally. I'll make that a feature request.