Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!portal!sv!daven From: daven@svc.portal.com Newsgroups: comp.sys.mac.programmer Subject: Re: Advice on icon animation wanted Message-ID: <1990Dec18.220806.8816@svc.portal.com> Date: 18 Dec 90 22:08:06 GMT References: <1116@babcock.cerc.wvu.wvnet.edu> <47444@apple.Apple.COM> Organization: Software Ventures Lines: 39 In article <47444@apple.Apple.COM> stevec@Apple.COM (Steve Christensen) writes: > In article <1116@babcock.cerc.wvu.wvnet.edu> un020070@vaxa.wvnet.edu writes: > >I am writing a program in which I am animating a lot of icons > >at one time. I want to keep the animation smooth and clean, and > >I also want to keep everything going at a constant rate regardless > >of the processor speed, which means that I will somehow have to involve > >the tick counter. I can think of two strategies for doing this: > > > >#1: Have the main program be constantly thinking about the animation > >of the icons, but handle the actual animation during the video > >horizontal retrace, when the processor is interrupted and when no > >drawing is taking place on the screen. I could have a queue of > >icons to be plotted, and plot just one during each retrace cycle. > >(I have never written a routine for the horizontal retrace interrupt, > >however, so this would mean doing some figuring.) > > You also can't draw from an interrupt routine because the heap may not be > consistent, and QuickDraw uses the Memory Manager for regions. However, if he refrains from calls that move memory, and manages to set A5 to the application's A5, then there's nothing preventing him from persuing this route. > >Second question: How do you draw an icon in XOR? Is this possible > >with the easy-to-use PlotIcon, or do I have to mess with some kind > >of bit transfer? > > Well, you should just be able to set the transfer mode to XOR and do the plot. No, IM I page 473 says this about PlotIcon: "It calls the QuickDraw procedure CopyBits and uses the srcCopy transfer mode." It looks like one must use CopyBits oneself with a srcXor mode. -- ------------------------------------------------------------------------------- Dave Newman | daven@svc.portal.com | AppleLink: D0025 Sofware Ventures Corp. | AOL: MicroPhone | CIS: 76004,2161 Berkeley, CA 94705 | WELL: tinman@well.sf.ca.us | (415) 644-3232