Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@iquest.net (Mario Perdue) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Jerky graphics Date: Thu, 19 Jun 1997 16:30:30 GMT Organization: SCEA Net Yaroze News Lines: 45 Message-ID: <33a95c49.6486485@205.149.189.29> References: <01bc7c89$6c62a860$6c37eccd@nsantos> <33a9466e.890798@205.149.189.29> <01bc7cda$9d15d620$d67acdcd@nsantos> NNTP-Posting-Host: firewall.hrtc.net X-Newsreader: Forte Free Agent 1.1/32.230 On 19 Jun 1997 14:54:46 GMT, "Nelson Santos" wrote: >My MoveHeroBullets seems to work ok when I fire more than one bullet. I >experimented with a few things, and I think I fixed it, but I still don't >know why. Referring back to the code (here is a segment:) > >... > if(NumHeroBullets > 0) > { > for(i=0 ; i < NumHeroBullets ; i += 1) > GsSortFastSprite(&HeroBullets[i], &OrdTab[Buffer], 0); > } > DrawSync(0); > VSync(0); > GsSwapDispBuff(); > GsSortClear(0, 0, 0, &OrdTab[Buffer]); > GsDrawOt(&OrdTab[Buffer]); > > if (GameOver == TRUE) break; >... > >All I did was move the "DrawSync(0);" to right after the >"GsDrawOt(&OrdTab[Buffer]);" > >Now this is against what the manuals say, but it works anyhow. No more >choppiness. Do you know why? Nelson, Just guessing, but I'd say your code is running right at the borderline of maintaining a framerate. When you add bullets you drop to the lower frame rate sometimes. Since it's not consistant, things look jerky. I suspect that printf takes enough time that it drops the frame rate more consistantly, so it appears to make the program run smoother. And it does, but a a reduced frame rate. The change you made would have a similar effect. The way you originally wrote the code, the system would be building the next frame while it was drawing the current frame. The way it is now, you wait until the current frame is drawn before you start building the next frame. You're still getting a fast enough frame rate, but you're wasting a bunch of CPU cycles. Mario