[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 >
Currently when a unit is moved the "animation" just slides the unit from
the starting to the destination location. A similar animation is used
for combat.
These animations are done via steps. The user specifies that the
animation takes 3 steps. Then each step moves the unit 1/3 of the way
and waits 20 ms.
This could be much better! The limiting factor here isn't the number of
steps but the drawing time.
My proposeal is that instead of specifying the number of steps, the user
specifies the animation time (default 60 ms). Now in the animation
instead of the current loop
for (each step) {
animate()
wait_until_next_step()
}
we'd have
while (time_is_remaining()) {
animate_to_where_we_should_be()
}
this makes the animation take a constant time on all computers
(controlled by the user), but it will be smoother on a faster computer.
With a 60ms animation this may not make much difference. However it
will give the user a more direct control over the animation, and will
work better on computers of different speeds.
Note that with real "animation" this generally wouldn't be possible.
We'd have a discrete number of frames for the animation and would have
to draw them precisely.
jason
- [Freeciv-Dev] (PR#7860) smoother unit "animation",
Jason Short <=
|
|