home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / SAT / SAT 2.1.2 notes < prev    next >
Encoding:
Text File  |  1994-07-26  |  3.8 KB  |  79 lines  |  [TEXT/ttxt]

  1. SAT 2.1.2 notes
  2. ==============
  3.  
  4. About time to leave the "2.0b#" numeration. Why isn't this 2.0 "final" then? Because that would cause confusion, while 2.1 clearly is later than 2.0b8. I'll try to use the standard version numbering from now on: minor bugfixes in the third number, minor changes in the second and major revisions in the first.
  5.  
  6. NEW FEATURES:
  7.  
  8. • Multi-channel sound! (Finally!) Several new calls added, but the only one you really need is SATSoundInitChannels.
  9. • The C version of FaceFromPICT had some minor bugs that are now fixed.
  10. • Added Collision ///, a demo in making everything in a different way. The most important things it demonstrates are (1) how to build a sprite from code (no cicn involved, not even a PICT) and (2) advanced collision detection, using the mask regions in the sprite faces to determine whether or not two sprites overlap.
  11. • The calls SATSetPort and SATGetPort are now available, intended for saving and restoring both port and device without having to bother about whether or not devices are available.
  12. • SetPortFace's twin brother SetPortFace2 makes it easier to scale sprites. (See Collision ///.)
  13.  
  14. INTERFACE CHANGES:
  15.  
  16. • NewSprite and NewSpriteAfter no longer take any handling and hit tasks, only a setup task. SEE BELOW for a guide to updating your programs! (It's not very hard, trust me.)
  17. • SATCopyBits and SATCopyBitsToScreen now take two Rects instead of two points, height and width, in order to conform better to CopyBits.
  18.  
  19. BUG FIXES:
  20.  
  21. • Fixed two bugs I introduced with the previous version, that could cause Macs without Color QuickDraw to get adress errors or unimplemented trap errors.
  22. • You may now safely call SATSoundInit before you initialize SAT. Previously, it was initialized in every InitSAT, which could cause sound channels to be left open. (No major problem.)
  23. • Collision detection is now right after movement, before drawing, which makes no difference for most programs, but is a change to the better for programs like Offscreen Toys.
  24. • A bug (due to a mistake when translating it from Pascal) fixed in FaceFromPICT.c.
  25.  
  26.  
  27.  
  28. HOW TO UPDATE YOUR PROGRAM TO THE NEW "NewSprite":
  29.  
  30. NewSprite and NewSpriteAfter no longer take any handling and hit tasks, only a setup task. This change was made to simplify the NewSprite call, and to improve encapsulation a bit. (I.e. why must the caller know what handling and hit routines the sprite intends to use? It doesn't.)
  31.  
  32. This requires minor changes in existing programs:
  33.  
  34.     - In all calls to NewSprite, remove the Handle* and Hit* routine pointers.
  35.     - In all setup routines, assign the fields task and hitTask (if any) in the sprite. 
  36.  
  37. Example:
  38.  
  39. {Pascal}
  40. procedure SetupMySprite(me: SpritePtr);
  41. begin
  42.     me^.task := @HandleMySprite;
  43.     me^.hitTask := @HitMySprite;    {If you have no hit task, skip this.}
  44.     {Plus hotRects and whatever more you need.}
  45. end;
  46.  
  47. /*C*/
  48. pascal void SetupMySprite(SpritePtr me) {
  49. me->task := &HandleMySprite;
  50. me->hitTask := &HitMySprite;    /*If you have no hit task, skip this.*/
  51. /*Plus hotRects and whatever more you need.*/
  52. }
  53.  
  54.  
  55. If you feel too lazy to make these updates (it only takes a few minutes, really!), you can plug the following routine in somewhere (in SAT.p if you like), and then replace all 'NewSprite' with 'MyNewSprite':
  56.  
  57. function MyNewSprite (kind, hpos, vpos: integer; callback, setup, theHittask: ProcPtr): SpritePtr;
  58. var
  59.     theSprite: SpritePtr;
  60. begin
  61.  theSprite := NewSprite (kind, hpos, vpos: integer; setup: ProcPtr): SpritePtr;
  62.  theSprite^.task := callback;
  63.  theSprite^.hitTask := theHittask;
  64.  MyNewSprite := theSprite;
  65. end;
  66.  
  67. ---------
  68. Changes from 2.1 to 2.1.1:
  69. • Added a destructTask to sprites
  70. • Fixed a bug that caused a memory leak
  71. • "Safe" graphics a tiny. tiny bit faster
  72. • C interface file slightly more C++ friendly
  73.  
  74. Changes from 2.1.1 to 2.1.2:
  75. • Bug fixes in Collision ///
  76. • Even better SAT.h
  77. • SATGetCicn now releases the "cicn" resource if it isn't needed
  78. • SATDisposeCicn added
  79.