Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!lll-winken!iggy.GW.Vitalink.COM!widener!dsinc!bagate!cbmvax!bj From: bj@cbmvax.commodore.com (Brian Jackson) Newsgroups: comp.sys.amiga.programmer Subject: Re: I can't get Flood() to work! Message-ID: <21486@cbmvax.commodore.com> Date: 11 May 91 07:03:24 GMT References: <15629@darkstar.ucsc.edu> <3238@sirius.ucs.adelaide.edu.au> Reply-To: bj@cbmvax.commodore.com (Brian Jackson) Organization: Commodore, West Chester, PA Lines: 41 In article <3238@sirius.ucs.adelaide.edu.au> jpotter@ucs.adelaide.edu.au (Jonathan Potter) writes: >In article <15629@darkstar.ucsc.edu> davids@ucscf.UCSC.EDU (Dave Schreiber) writes: >>I'm having a problem figuring out how the Flood() function works. I've >>been able to get flood mode #0 (flood to the outline color) to work, but >>it's incredibly slow (even on my 3000), and not really what I want anyway. >>Mode #1 (flood the block of color at the given coordinates), on the other >>hand, looks like it will fit the bill, but I haven't been able to get it to >>work. Here's a code sample that illustrates what I'm trying to do > >You need to allocate a TmpRas, and set the TmpRas pointer of the rastport to >that. The TmpRas (presumably short for temporary rastport) is the same height >and width as your window's rastport, but only one bit-plane deep. Check the RKM >for more info, as I can't remember exactly how its done of the top of my head. >Jon It goes something like: struct TmpRas myTmpRas ; PLANEPTR *trptr ; struct Window *myWindow ; LONG bits_wide, bits_high ; ... OpenWindow() ... ... if(trptr = AllocRaster( bits_wide, bits_high)) { InitTmpRas( &myTmpRas, trptr, (LONG)(RASSIZE(bits_wide,bits_high))) ; myWindow->RPort->TmpRas = &myTmpRas ; } Brian ----------------------------------------------------------------------- | Brian Jackson Software Engineer, Commodore-Amiga Inc. GEnie: B.J. | | bj@cbmvax.cbm.commodore.com or ...{uunet|rutgers}!cbmvax!bj | | "My beer comes from farther away than your beer." | -----------------------------------------------------------------------