home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / SprocketInvaders / Source / Sprite.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  1.8 KB  |  60 lines  |  [TEXT/MPS ]

  1. //•    ------------------------------------------------------------------------------------------    •
  2. //•
  3. //•    Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  4. //•
  5. //•
  6. //•        You may incorporate this sample code into your applications without
  7. //•        restriction, though the sample code has been provided "AS IS" and the
  8. //•        responsibility for its operation is 100% yours.  However, what you are
  9. //•        not permitted to do is to redistribute the source as "DSC Sample Code"
  10. //•        after having made changes. If you're going to re-distribute the source,
  11. //•        we require that you make it clear in the source that the code was
  12. //•        descended from Apple Sample Code, but that you've made changes.
  13. //•
  14. //•        Authors:
  15. //•            Chris De Salvo
  16. //•
  17. //•    ------------------------------------------------------------------------------------------    •
  18.  
  19. #ifndef __SPRITES__
  20. #define __SPRITES__
  21.  
  22. //•    ------------------------------    Includes
  23.  
  24. #include <QDOffscreen.h>
  25.  
  26. //•    ------------------------------    Public Definitions
  27. //•    ------------------------------    Public Types
  28.  
  29. typedef struct Frame
  30. {
  31.     UInt16    height, width;
  32.     SInt16    hotX, hotY;
  33.     UInt8    *image;
  34. } Frame, *FramePtr;
  35.  
  36. typedef struct Sprite
  37. {
  38.     UInt16        numFrames;
  39.     FramePtr    *frames;
  40. } Sprite, *SpritePtr;
  41.  
  42. //•    ------------------------------    Public Variables
  43. //•    ------------------------------    Public Functions
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. extern SpritePtr SpriteLoad(SInt16 resNum);
  50. extern Rect SpriteDraw(SpritePtr theSprite, UInt32 frameNum, CGrafPtr dest, SInt32 x, SInt32 y);
  51. extern void SpriteDispose(SpritePtr *theSprite);
  52. extern UInt16 SpriteHeight(SpritePtr whichSprite, UInt16 whichFrame);
  53. extern UInt16 SpriteWidth(SpritePtr whichSprite, UInt16 whichFrame);
  54. extern Boolean IntersectRects(const RectPtr a, const RectPtr b);
  55.  
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59.  
  60. #endif