home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 20064 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.4 KB

  1. Path: sparky!uunet!stanford.edu!apple!sansorge.kaleida.com!user
  2. From: ansorge@kaleida.com (Sean Ansorge)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: problem with animation program
  5. Message-ID: <ansorge-181292151451@sansorge.kaleida.com>
  6. Date: 18 Dec 92 23:51:02 GMT
  7. Sender: daemon@Apple.COM
  8. Followup-To: comp.sys.mac.programmer
  9. Organization: Kaleida Labs, Inc.
  10. Lines: 37
  11.  
  12. I'm writing a real-time animation package and am having a problem I can't
  13. track down. The program consists of your typical event loop plus another
  14. animation loop, in which sprites are drawn to the screen from an offscreen
  15. buffer and sounds are played. All objects are allocated before the drawing
  16. loop is entered, and all objects are pointer-based (Think C "direct").
  17. There is an instance variable that acts as a flag to tell an object if it's
  18. active or not, and when I need a new object of a particular type I walk the
  19. inactive object list and activate one of the needed objects by setting the
  20. flag.
  21.  
  22. All well and good, but after this loop has been running for a while, there
  23. starts to be a quite noticeable pause whenever a deactivated object is
  24. activated. This only happens after the loop has been going for a while. If
  25. I exit the loop and return to the main event loop, wait a second, and
  26. re-enter the animation loop, the problem vanishes and object activation
  27. becomes instantateous. Another thing that happens when the animation loop
  28. is paused is a flicker which appears to be some of the drawing calls
  29. "catching up", but I'm not sure what it is.
  30.  
  31. I am using GWorlds for the offscreen buffers, and I am locking the pixmaps,
  32. and am using CopyBits and CopyMask to do the drawing.
  33.  
  34. Examination of my heap shows that something is indeed moving about, but
  35. it's nothing I have control over; all my objects are pointer-based and all
  36. other data I allocate space for is locked down. I wondered if perhaps
  37. something in the way Think's method-dispatching engine works could be
  38. causing heap compaction or other memory movement.
  39.  
  40. All of this happens regardless of wether the sound calls are made (I'm
  41. using SndPlay, but when sound is off I don't call it).
  42.  
  43. I'd appreciate any suggestions.
  44.  
  45. .........................................................................
  46. Sean Ansorge                                               (415) 966-0865
  47. Kaleida Labs, Inc.                                    ansorge@kaleida.com
  48. .........................................................................
  49.