home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5592 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.2 KB

  1. Path: sparky!uunet!usc!isi.edu!dstrout
  2. From: dstrout@isi.edu (David Strout)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Summary: Animating lots of small bitmaps
  5. Message-ID: <22201@venera.isi.edu>
  6. Date: 13 Aug 92 12:07:28 GMT
  7. References: <22171@venera.isi.edu>
  8. Reply-To: dstrout@darpa.mil (David Strout)
  9. Distribution: usa
  10. Organization: Information Sciences Institute, Univ. of So. California
  11. Lines: 33
  12.  
  13.  
  14. Well, I got several responses from people (Thank you one and all!).
  15. For my particular problem(bad flicker when animating a bunch of
  16. bitmaps, each in a subview, in a large main view), turns out the the 
  17. flashing was due to the way I was erasing my bitmaps before
  18. re-drawing.  
  19. I was doing it like this:
  20.  
  21. - drawSelf:(NXRect *)rects :(int)rectCount 
  22. {
  23.  
  24.     PSsetgray(0);
  25.     NXRectFill(rects);
  26.  
  27.     [self moveBy: 7 :0];
  28.  
  29.     [ship composite:NX_SOVER toPoint:&bounds.origin]; 
  30.  
  31.     return self;
  32. }
  33.  
  34. where ship is an NXImage.  When I replaced the PSsetgray and
  35. NXRectFill calls with [backGround composite:NX_SOVER
  36. toPoint:&bounds.origin] where backGround is an NXImage the same size
  37. as ship, initialized to the background, the flicker went away.  Better
  38. examples of this are in BackSpace, by Sam Streeper, and PacMan, by Don
  39. Yacktman.
  40.  
  41. Thanks again for the helpful suggestions.
  42.  
  43. dave.
  44.  
  45.  
  46.