Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!decuac!shlump.nac.dec.com!shodha.dec.com!elvira!ridder From: ridder@elvira.enet.dec.com (Hans Ridder) Newsgroups: comp.sys.amiga.tech Subject: Re: DrawImage() woes. (LONG) Keywords: DrawImage(), PlanePick, PlaneOnOff Message-ID: <625@shodha.dec.com> Date: 19 Jan 90 21:40:30 GMT References: <487@dsoft.UUCP> <1990Jan17.101103.10084@gdt.bath.ac.uk> <9389@cbmvax.commodore.com> Sender: news@shodha.dec.com Organization: Digital Equipment Corporation, Customer Support Center Lines: 34 In article <9389@cbmvax.commodore.com> peter@cbmvax.commodore.com (Peter Cherna) writes: >If your compiler doesn't support the "chip" keyword, then >leave out the word "chip" above and say > > ChipData = (UWORD *)AllocMem(sizeof(ImageData), MEMF_CHIP); > if (ChipData) > { > CopyMem(ImageData, ChipData, sizeof(ImageData)); > myImage.ImageData = ChipData; > ... > } > else > { > /* chip mem allocation failed */ > } In this case, wouldn't be a good idea to use the TypeOfMem() Exec function to determine if the ImageData was was already in chip memory? Something like (I don't have the RKM's here, so no snickering): if ((TypeOfMem(ImageData) & MEMF_CHIP) == 0) { ChipData = (UWORD)AllocMem(sizeof(ImageData), MEMF_CHIP); ... /* All the stuff you had */ } > Peter Cherna, Software Engineer, Commodore-Amiga, Inc. > {uunet|rutgers}!cbmvax!peter peter@cbmvax.cbm.commodore.com -hans ======================================================================== Hans-Gabriel Ridder Digital Equipment Corporation ridder@elvira.enet.dec.com Customer Support Center ...decwrl!elvira.enet!ridder Colorado Springs, CO