Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8073) win32: unit moves aren't smooth
Home

[Freeciv-Dev] Re: (PR#8073) win32: unit moves aren't smooth

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8073) win32: unit moves aren't smooth
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 16 Mar 2004 10:03:23 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8073 >

On Mon, 15 Mar 2004, Jason Short wrote:

> I believe ftime() should work.
>
> Also, if neither function is present we should not fall back to time().
>   We should just fail.  1-second resolution isn't enough for a lot of
> the work we have to do.  For instance I guess the old win32 animation
> code didn't work either, but nobody noticed since it happened so
> quickly.  When units actually have real animations this just won't be
> acceptable.  And every platform should have an alternative function with
> at least millisecond resolution.

time() is a decent fallback. It is ANSI C, so every platform will have it.
We use the timers for more than just unit animation you know? :)

Besides, you can play without unit animation, you can't play with a client
or server which won't even compile.

BTW, clock() is also standard and is higher resolution than time(), if
very variable in resolution across machines and hence weird.

gettimeofday() doesn't have a very good resolution on some systems either.
Accurate high-resolution timers are a problem for sure and each platform
usually has its own special way of doing them.

Multimedia apps use these timers a lot.

ftime() has similar resolution to gettimeofday(). If you want better
resolution on Windows, try GetTickCount() or QueryPerformanceCounter().

Beware that such high-resolution timers are usually reset on boot
and quickly get out of space even with 64-bits of resolution, so you will
get timer wraparounds if your game stays up too long.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





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