[Freeciv-Dev] (PR#7860) smoother unit "animation"
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7860 >
I don't really like busy-waiting animation as a whole.
How hard would it be to set up a list of active animations, and animate
them for a single frame during the main loop of the client?
Something like this:
static time lasttime;
if (currenttime-lasttime > 20ms)
lasttime=currenttime
foreach(animation in list)
update&draw(animation)
if done(animation)
remove(list, animation)
This would also facilitate tile animations and simultaneous animations.
Also, we could add a "bail out" inside the for loop, in case the
animations are taking too long.
This does raise a few hard questions though. Do we lock the controls
when a unit movement animation is occurring, to prevent strange
paradoxes from happening? And wouldn't this force a refresh of the
mapview every 20 ms?
-James Canete
|
|