home *** CD-ROM | disk | FTP | other *** search
- Path: sourcery.han.de!not-for-mail
- Newsgroups: comp.sys.amiga.programmer
- References: <19960223.7D2BD90.9087@mojaveg.ridgecrest.ca.us>
- From: "Olaf Barthel" <olsen@sourcery.han.de>
- Date: Sat, 24 Feb 1996 14:56:37 +0100
- X-NewsReader: IntuiNews 1.3a (7.9.95)
- Subject: Re: FLOOD() questions
- Message-ID: <13213653@sourcery.han.de>
-
- In Article <19960223.7D2BD90.9087@mojaveg.ridgecrest.ca.us>, Everett M. Greene <mojaveg@ridgecrest.ca.us> wrote:
- > I've been experimenting with the Flood() graphics operation
- > and am finding much ambiguity in the RKM explanation. I've
- > included an excerpt of the code I've tried (which doesn't
- > work).
- >
- > void do_window_magic(struct Window *wp)
- > {
- > ULONG tmp_size;
- > PLANEPTR plane;
- > struct TmpRas tr;
- >
- > tmp_size = RASSIZE(wp->Width, wp->Height) * wp->WScreen->BitMap.Depth;
- > if (plane = AllocRaster(wp->Width, wp->Height)) {
- > InitTmpRas(&tr, plane, tmp_size);
- > wp->RPort->TmpRas = &tr;
- > Flood(wp->RPort, 1, wp->BorderLeft + 1, wp->BorderTop + 1);
- > FreeRaster(plane, wp->Width, wp->Height);
- > }
- > }
- >
- > Questions:
- >
- > 1. How does the size computed by RASSIZE compare to that
- > generated by AllocRaster() from its width and height
- > parameters?
-
- This has never been set in stone. While you cannot assume that the number
- of bytes AllocRaster() allocates will match what the RASSIZE macro tells you,
- you can be certain that the size it returns will be suitable for initializing
- the TmpRas with.
-
- > 2. Does AllocRaster() allocate CHIP memory?
-
- Let's put it this way, AllocRaster() will return memory that can be used
- for operating system usage. This means, you will be able to feed the result
- into BitMaps and get something out of them (RasInfo, Layer, RastPort, etc.).
- I wouldn't bet on getting chip memory, though.
-
- > 3. Do you have to AllocRaster() for each bit plane or will
- > one allocation suffice for the whole temp raster?
-
- One (1) plane is sufficient.
-
- > 4. If one is flooding within a window, does the temp raster
- > need to be any larger than the window? [The RKM says
- > something about making the temp raster the same size as
- > the screen which would seem unnecessary.]
-
- Better look at the size of the BitMap in your RastPort. That is, under
- v39 and up use GetBitMapAttr() to query width and height and submit this data
- to AllocRaster(), under v37 and below look into BitMap->BytesPerRow and
- multiply with eight and BitMap->Rows, respectively.
-
- --
- Home: Olaf Barthel, Brabeckstrasse 35, D-30559 Hannover
- Net: olsen@sourcery.han.de
-