home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!qwerty-gw.fsl.noaa.gov!yoda.fsl.noaa.gov!urban
- From: urban@yoda.fsl.noaa.gov (Art Urban)
- Subject: Re: More on TCL Nightmare.....................................
- Message-ID: <1993Jan25.194042.18023@fsl.noaa.gov>
- Sender: urban@fsl.noaa.gov
- Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
- References: <1993Jan22.010015.17871@netcom.com> <93023.121559REE700A@MAINE.MAINE.EDU> <1993Jan23.234716.1435@kth.se>
- Date: Mon, 25 Jan 1993 19:40:42 GMT
- Lines: 28
-
- In article <1993Jan23.234716.1435@kth.se> d88-jwa@cyklop.nada.kth.se (Jon Wtte) writes:
- %In <93023.121559REE700A@MAINE.MAINE.EDU> REE700A@MAINE.MAINE.EDU writes:
- %
- %> Now, this amounts to 60,000 LongRects (hence 240,000 LongInt assigns,
- %>and 120,000 LongInt adds, so the math of generation is non-negigible.
- %
- %> Any useful suggestions on how to speed this process up?
- %
- %Yes, it's very simple; your Draw() method gets a Rect passed
- %to it; that Rect contains the area that actually needs to
- %be drawn. I don't know what data structures you have, but
- %some simple binary search over sorted coordinates, or some
- %other clever way of knowing what rectangles to draw without
- %checking each and every one would probably help tremendously.
- % -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
-
- Along the same lines, I found that using SectRect() with the rect that gets
- passed to Draw, and the rect of the obejct I want to draw, will result in
- a non-empty rectangle if the object needs to be drawn. This way I could
- skip all draw calls to objects outside of the intersection as they were
- empty rects. This sped things up *considerably*.
-
-
- --
- Art Urban urban@yoda.fsl.noaa.gov
- ===============================================================================
- "Look, he's being attacked by creamy nugget centers." -Joel
- ===============================================================================
-