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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8073) win32: unit moves aren't smooth
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Mon, 15 Mar 2004 01:31:02 -0800
Reply-to: rt@xxxxxxxxxxx

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

I noticed from my recent CVS builds (after applying my win32 antifreeze
patch, PR#7778) that since unit movement animations have been done in
real time, the win32 client doesn't have smooth animation at all.

I inserted a freelog check in move_unit_map_canvas() to track the x and
y coordinates of the moving sprite, but found that they never moved
until the final step.

I moved on to dump the results from read_timer_seconds, and got this:

1: animating: read_timer_seconds(anim_timer) = 0.000000
1: last message repeated 2 times
1: last message repeated 2 times (total 4 repeats)
1: last message repeated 4 times (total 8 repeats)
1: last message repeated 8 times (total 16 repeats)
1: last message repeated 16 times (total 32 repeats)
1: last message repeated 32 times (total 64 repeats)
1: last message repeated 64 times (total 128 repeats)
1: last message repeated 128 times (total 256 repeats)
1: last message repeated 31 times (total 287 repeats)
1: animating: read_timer_seconds(anim_timer) = 1.000000

The resolution of read_timer_seconds() under win32 is one second, which
is awful.

After a little research, I find that mingw has no support for
gettimeofday(), which is required for millisecond resolution for freeciv
timers.

I could probably insert some win32-specific code into timers.c to create
my own gettimeofday() function, but I'm hesitant to even touch such core
code, much less insert a bunch of #defines into it.

Also, this problem will show up on other platforms without gettimeofday().

-James Canete


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8073) win32: unit moves aren't smooth, James Canete <=