

#define PARTICLE_CHILD				1		// The particles position is based of the pos of the system
#define PARTICLE_REINCARNATION		2		// The particle is re-born when it dies
#define PARTICLE_ANIMATE			4		// Use an array of pointers to texture of animating
#define PARTICLE_GRAVITY			8		// The particles Y velocity is affected by gravity
#define PARTICLE_CUSTOM_GENERATE	16
#define PARTICLE_CUSTOM_UPDATE		32
#define PARTICLE_CUSTOM_DRAW		64
#define PARTICLE_ADDITIVE			128		// CPW: use +ve alpha thingy instead of colour key
#define PARTICLE_RAINBOW			256		// CPW: rainbow stuff
#define PARTICLE_SPHERICAL			512
#define PARTICLE_RANDOMLIFE			1024


typedef struct tagPARTICLE
{
	VECTOR	pos;
	VECTOR	vel;
	short	maxLife;
	short	lifeCtr;
	int		gravAccel;
}PARTICLE;


typedef struct tagPARTICLEFX
{
	struct tagPARTICLEFX *prev;
	struct tagPARTICLEFX *next;

	VECTOR			origin;
	int				nParticles;
	PARTICLE		*pParticles;

	TextureType		*pSprite;
	unsigned long	flags;
	unsigned long	colour;
}PARTICLEFX;

typedef struct tagPARTICLEFXLIST
{
	PARTICLEFX head;
	int numEntries;
}PARTICLEFXLIST;

PARTICLEFX *particleAdd(VECTOR *origin, TextureType *pSpr, int numParticles, int speed, int maxLife, unsigned long colour, unsigned long flags);
int particleProcessAll(void);
int particleDrawAll(void);
int particleCount(void);
int particleInitialiseList(void);
