home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22172 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.9 KB  |  40 lines

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