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.
NEW FEATURES:
• Multi-channel sound! (Finally!) Several new calls added, but the only one you really need is SATSoundInitChannels.
• The C version of FaceFromPICT had some minor bugs that are now fixed.
• 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.
• 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.
• SetPortFace's twin brother SetPortFace2 makes it easier to scale sprites. (See Collision ///.)
INTERFACE CHANGES:
• 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.)
• SATCopyBits and SATCopyBitsToScreen now take two Rects instead of two points, height and width, in order to conform better to CopyBits.
BUG FIXES:
• Fixed two bugs I introduced with the previous version, that could cause Macs without Color QuickDraw to get adress errors or unimplemented trap errors.
• 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.)
• 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.
• A bug (due to a mistake when translating it from Pascal) fixed in FaceFromPICT.c.
HOW TO UPDATE YOUR PROGRAM TO THE NEW "NewSprite":
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.)
This requires minor changes in existing programs:
- In all calls to NewSprite, remove the Handle* and Hit* routine pointers.
- In all setup routines, assign the fields task and hitTask (if any) in the sprite.
Example:
{Pascal}
procedure SetupMySprite(me: SpritePtr);
begin
me^.task := @HandleMySprite;
me^.hitTask := @HitMySprite; {If you have no hit task, skip this.}
{Plus hotRects and whatever more you need.}
end;
/*C*/
pascal void SetupMySprite(SpritePtr me) {
me->task := &HandleMySprite;
me->hitTask := &HitMySprite; /*If you have no hit task, skip this.*/
/*Plus hotRects and whatever more you need.*/
}
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':