#ifndef PARTICLE_H #define PARTICLE_H #include typedef struct _xsw_particle_struct xsw_particle_struct; #define XSW_PARTICLE(p) ((xsw_particle_struct *)(p)) /* * Types: */ #define XSW_PARTICLE_TYPE_UNKNOWN 0 #define XSW_PARTICLE_TYPE_SMOKE 1 /* Drifting animated smoke or * fire trails */ #define XSW_PARTICLE_TYPE_EFFECT 2 /* Stationary animated sprite */ #define XSW_PARTICLE_TYPE_SHOCKWAVE 3 /* * Particle: */ struct _xsw_particle_struct { int type; /* One of XSW_PARTICLE_TYPE_* */ int imgref_num; long size_start, size_end; /* Of particle, in screen * units */ long sect_x, sect_y, sect_z; float x, y, z; /* In real units */ float heading, pitch, bank; time_t birth_time, /* In ms */ life_span; /* In ms */ }; extern xsw_particle_struct **xsw_particle; extern int total_particles; int ParticleCreate( xsw_particle_struct ***list, int *total, int type, int imgref_num, long sect_x, long sect_y, long sect_z, float x, float y, float z, float heading, float pitch, float bank, long size_start, long size_end, time_t birth_time, /* In ms */ time_t life_span /* In ms */ ); void ParticleClear(xsw_particle_struct ***list, int *total); void ParticleUpdateAll( xsw_particle_struct ***list, int *total, const time_t cur_ms, const time_t cur_sec, const float tc ); #endif /* PARTICLE_H */