home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-10-06 | 2.5 KB | 99 lines | [TEXT/CWIE] |
- ///--------------------------------------------------------------------------------------
- // SWParticles.h
- ///--------------------------------------------------------------------------------------
-
-
- #ifndef __PARTICLES__
- #define __PARTICLES__
-
- #ifndef __QUICKDRAW__
- #include <QuickDraw.h>
- #endif
-
- #ifndef __SWCOMMON__
- #include <SWCommonHeaders.h>
- #endif
-
- #ifndef __SPRITEWORLD__
- #include <SpriteWorld.h>
- #endif
-
- #ifndef __SPRITEFRAME__
- #include <SpriteFrame.h>
- #endif
-
- #ifndef __SPRITE__
- #include <Sprite.h>
- #endif
-
- #include <SWFixed.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
-
- ///--------------------------------------------------------------------------------------
- // type definitions
- ///--------------------------------------------------------------------------------------
-
- typedef struct Particle
- {
- short lifeRemaining; // How many frames of animation is left for this particle.
- // If it is 0 then this particle is not in the animation
- SWFixed horizLoc; // Current horizontal position of the particle
- SWFixed vertLoc; // Current vertical position of the particle
- SWFixed oldHorizLoc; // Horizontal position of particle the previous frame
- SWFixed oldVertLoc; // Vertical position of particle the previous frame
- SWFixed horizSpeed; // To be used by the user to move the star
- SWFixed vertSpeed; // To be used by the user to move the star
- unsigned long color; // The particle's color.
- } Particle, *ParticlePtr;
-
-
- ///--------------------------------------------------------------------------------------
- // Function prototypes
- ///--------------------------------------------------------------------------------------
-
- SW_FUNC OSErr InitParticles(long NumParticles, SWFixed Gravity);
-
- SW_FUNC void ClearParticles( void );
-
- SW_FUNC void NewParticle(
- unsigned long color,
- SWFixed horizLoc,
- SWFixed vertLoc,
- SWFixed horizSpeed,
- SWFixed vertSpeed,
- short lifeRemaining);
-
-
- SW_FUNC void EraseParticlesOffscreen( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void EraseParticlesScrollingOffscreen( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void DrawParticlesOffscreen( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void DrawParticlesScrollingOffscreen( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void UpdateParticlesInWindow( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void UpdateParticlesInScrollingWindow( SpriteWorldPtr spriteWorldP );
-
- SW_FUNC void MoveParticles( void );
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __PARTICLES__ */
-