Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!helios!stat!aaron From: aaron@stat.tamu.edu (Aaron Hightower) Newsgroups: comp.sys.amiga.programmer Subject: Re: Sprite Animation Glitches Message-ID: <15664@helios.TAMU.EDU> Date: 1 May 91 18:53:26 GMT References: Sender: usenet@helios.TAMU.EDU Organization: Texas A&M University Lines: 37 In article ersys!kumbach@nro.cs.athabascau.ca (Kevin Umbach) writes: >When I simply move the sprites around the screen, they move >very quickly without any flicker. However, when I animate them >by changing their image data every time the sprites move, >considerable flicker or glitches occur. (Yes I do WaitTOF() ) > >Basically all I do to change a sprites image is do a memcpy() >from an array into the sprite's image data area and I believe >this is where the glitches originate from. > >Can anyone suggest a fix or technique they use? I have thought >about double buffering the sprite image data by doing the memcpy() >into the second image buffer then using ChangeSprite() to point >to this buffer. Has anyone tried this before? I have one game that uses memcpy to change the sprite image, and I have also noted the "glitches". My theory is that is has something to do with the blitter (I think I remember this function being able to use the blitter). In other words, the action of memcpy may be asyncronous. Another game that I wrote used the technique where the images are all stored separately in CHIP mem. Then a ChangeSprite would display the desired sprite. Your idea for double buffering will work fine, but you may need three image slots. Current (on screen), Next (already copied and waiting), and next next (The one you can copy to). This way you won't ever do a ChangeSprite to an Image that is in the process of a memcpy(). Good luck, Aaron Hightower > >Any info will be appreciated. > >Kevin Umbach ersys!kumbach@nro.cs.athabascau.ca >Edmonton Remote Systems: Serving Northern Alberta since 1982