Re: [Tuxnes-devel] Smoother scrolling
Brought to you by:
tmmm
From: Jason D. S. <jd...@us...> - 2004-01-19 19:27:56
|
Jason Dorje Short wrote: > Mike Mestnik wrote: > >> I was chasing a simular problem, but I coulden't get any thing to >> work. I don't think it's >> correct to cahnge the usleep, as it's based on the NTSC standared. >> I.E. 16666 = 1 frame and if >> were n frames ahead 16666 * ( n - 1 ) is how long we wait. > > > You don't want to usleep for a fixed amount of time, or you'll get > *behind*. For instance if you sleep for 10 useconds and then do some > calculations that take 5 useconds, your tick length is actually 5 > useconds instead of 10 useconds as you wanted it to be. (Just using 10 > as an example.) Well, that patch didn't work at all. The problem, though, is that you're tracking time in frames instead of in useconds. If you're half a frame ahead and you wait for one frame, then you'll be half a frame behind. Or if you wait until you're a frame and a half ahead and then wait a frame, you get uneven playing (2 frames in quick succession, then a wait before the next frame). This is hard to change because timeframe is a very different concept. But this patch may be a little better (now that I got tuxnes to compile). It's indistinguishable from the current behavior on my computer. jason |