Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] (PR#7860) smoother unit "animation"
Home

[Freeciv-Dev] (PR#7860) smoother unit "animation"

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7860) smoother unit "animation"
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Fri, 12 Mar 2004 00:58:22 -0800
Reply-to: rt@xxxxxxxxxxx

<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


[Prev in Thread] Current Thread [Next in Thread]