Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!spence From: spence@cbmvax.commodore.com (Spencer Shanson) Newsgroups: comp.sys.amiga.programmer Subject: Re: hardware sprites Keywords: sprites Message-ID: <22303@cbmvax.commodore.com> Date: 10 Jun 91 17:47:01 GMT References: <19672@csli.Stanford.EDU> <2979@public.BTR.COM> <22258@cbmvax.commodore.com> <2987@public.BTR.COM> Reply-To: spence@cbmvax.commodore.com (Spencer Shanson) Organization: Commodore, West Chester, PA Lines: 47 In article <2987@public.BTR.COM> valentin@public.BTR.COM (Valentin Pepelea) writes: >In article <22258@cbmvax.commodore.com> spence@cbmvax.commodore.com (Spencer >Shanson) writes: >> >>Valentin, ChangeSprite() has to MoveSprite(), whereas FreeSprite() >>is much simpler - point the sprite to a default sprite of 0s. I would be >>surprised if you have found ChangeSprite() to be faster than FreeSprite(). > >On the other hand, restoring the sprite will require an additional call to >GetSprite(). So the question is whether FreeSprite() and GetSprite() together >are faster than just ChangeSprite(), praticularly when you take into account >the overhead of calling these functions. There are advantages to having access >to the source code, so why don't you tell me. > OK - we can either: 1) ChangeSprite() to offscreen 2) ChangeSprite() to onscreen or 1) FreeSprite() 2) GetSprite() 3) ChangeSprite() Now, GetSprite() is another simple function, whereas MoveSprite(), which is called indirectly when you use ChangeSprite(), is a relatively complex piece of code. So because a FreeSprite()/GetSprite() combination is one less call to ChangeSprite(), I believe it would be the faster method *from code inspection*. I haven't proved it though with experimentation. >Valentin >-- >"An operating system without virtual memory Name: Valentin Pepelea > is an operating system without virtue." Phone: (408) 985-1700 > Usenet: mips!btr!valentin > - Ancient Inca Proverb Internet: valentin@btr.com -- --------------------------------------------------------------------------- Spencer Shanson - Amiga Software Engineer | email: spence@commodore.COM | or uunet!cbmvax!spence All opinions expressed are my own, and do not | Bix: sshanson (necessarily) represent those of Commodore. | "Copper? I hardly even | know her!"