2004-08-23 00:15:46 +00:00
# ifndef _PARTICLES_H_
# define _PARTICLES_H_
2008-11-09 22:29:28 +00:00
extern int
2004-08-23 00:15:46 +00:00
pt_gunshot ,
2008-11-09 22:29:28 +00:00
ptdp_gunshotquad ,
2004-08-23 00:15:46 +00:00
pt_spike ,
2008-11-09 22:29:28 +00:00
ptdp_spikequad ,
2004-08-23 00:15:46 +00:00
pt_superspike ,
2008-11-09 22:29:28 +00:00
ptdp_superspikequad ,
pt_wizspike ,
pt_knightspike ,
pt_explosion ,
ptdp_explosionquad ,
pt_tarexplosion ,
2004-08-23 00:15:46 +00:00
pt_teleportsplash ,
2008-11-09 22:29:28 +00:00
pt_lavasplash ,
ptdp_smallflash ,
ptdp_flamejet ,
ptdp_flame ,
ptdp_blood ,
ptdp_spark ,
ptdp_plasmaburn ,
ptdp_tei_g3 ,
ptdp_tei_smoke ,
ptdp_tei_bigexplosion ,
ptdp_tei_plasmahit ,
ptdp_stardust ,
2005-03-15 22:51:01 +00:00
rt_rocket ,
rt_grenade ,
2004-08-23 00:15:46 +00:00
rt_blood ,
2008-11-09 22:29:28 +00:00
rt_wizspike ,
rt_slightblood ,
rt_knightspike ,
rt_vorespike ,
rtdp_neharasmoke ,
rtdp_nexuizplasma ,
rtdp_glowtrail ,
ptqw_blood ,
ptqw_lightningblood ,
ptq2_blood ,
rtq2_railtrail ,
rtq2_blastertrail ,
ptq2_blasterparticles ,
rtq2_bubbletrail ,
rtq2_gib ,
rtq2_rocket ,
rtq2_grenade ,
rtqw_railtrail , //common to zquake/fuhquake/fte
rtfte_lightning1 ,
ptfte_lightning1_end ,
rtfte_lightning2 ,
ptfte_lightning2_end ,
rtfte_lightning3 ,
ptfte_lightning3_end ,
ptfte_bullet ,
ptfte_superbullet ;
2004-08-23 00:15:46 +00:00
2005-05-30 04:34:47 +00:00
struct beamseg_s ;
typedef struct trailstate_s {
struct trailstate_s * * key ; // key to check if ts has been overwriten
struct trailstate_s * assoc ; // assoc linked trail
struct beamseg_s * lastbeam ; // last beam pointer (flagged with BS_LASTSEG)
union {
float lastdist ; // last distance used with particle effect
2005-08-06 22:39:28 +00:00
float statetime ; // time to emit effect again (used by spawntime field)
2006-02-17 02:51:59 +00:00
} state1 ;
2005-08-06 22:39:28 +00:00
union {
float laststop ; // last stopping point for particle effect
float emittime ; // used by r_effect emitters
2006-02-17 02:51:59 +00:00
} state2 ;
2005-05-30 04:34:47 +00:00
} trailstate_t ;
2008-11-09 22:29:28 +00:00
# define PARTICLE_Z_CLIP 8.0
2007-05-25 22:16:29 +00:00
2014-01-13 02:42:25 +00:00
typedef enum { BM_BLEND , BM_BLENDCOLOUR , BM_ADDA , BM_ADDC , BM_SUBTRACT , BM_INVMODA , BM_INVMODC } blendmode_t ;
2004-08-23 00:15:46 +00:00
# define frandom() (rand()*(1.0f / RAND_MAX))
# define crandom() (rand()*(2.0f / RAND_MAX)-1.0f)
# define hrandom() (rand()*(1.0f / RAND_MAX)-0.5f)
2008-11-09 22:29:28 +00:00
# define P_INVALID -1
2005-05-18 23:15:58 +00:00
2005-08-06 22:39:28 +00:00
# define P_RunParticleEffectType(a,b,c,d) P_RunParticleEffectState(a,b,c,d,NULL)
2005-03-10 03:55:18 +00:00
2006-05-06 06:26:02 +00:00
// used for callback
extern cvar_t r_particlesdesc ;
2010-07-11 02:22:39 +00:00
extern cvar_t r_particlesystem ;
2006-05-06 06:26:02 +00:00
2008-11-09 22:29:28 +00:00
struct model_s ;
struct msurface_s ;
2009-10-06 00:31:48 +00:00
void P_InitParticleSystem ( void ) ;
2011-01-30 01:32:30 +00:00
void P_Shutdown ( void ) ;
2010-12-05 02:46:07 +00:00
void P_LoadedModel ( struct model_s * mod ) ; /*checks a model's various effects*/
2008-11-09 22:29:28 +00:00
void P_DefaultTrail ( struct model_s * model ) ;
void P_EmitEffect ( vec3_t pos , int type , trailstate_t * * tsk ) ; //this is just a wrapper
# define P_FindParticleType pe->FindParticleType
# define P_RunParticleEffectTypeString pe->RunParticleEffectTypeString
# define P_ParticleTrail pe->ParticleTrail
# define P_RunParticleEffectState pe->RunParticleEffectState
# define P_RunParticleWeather pe->RunParticleWeather
# define P_RunParticleCube pe->RunParticleCube
# define P_RunParticleEffect pe->RunParticleEffect
# define P_RunParticleEffect2 pe->RunParticleEffect2
# define P_RunParticleEffect3 pe->RunParticleEffect3
# define P_RunParticleEffect4 pe->RunParticleEffect4
# define P_ParticleTrailIndex pe->ParticleTrailIndex
# define P_EmitSkyEffectTris pe->EmitSkyEffectTris
# define P_InitParticles pe->InitParticles
# define P_DelinkTrailstate pe->DelinkTrailstate
# define P_ClearParticles pe->ClearParticles
# define P_DrawParticles pe->DrawParticles
typedef struct {
char * name1 ;
char * name2 ;
int ( * FindParticleType ) ( char * name ) ;
2012-01-17 07:57:46 +00:00
qboolean ( * ParticleQuery ) ( int type , int body , char * outstr , int outstrlen ) ;
2008-11-09 22:29:28 +00:00
int ( * RunParticleEffectTypeString ) ( vec3_t org , vec3_t dir , float count , char * name ) ;
2011-10-27 16:16:29 +00:00
int ( * ParticleTrail ) ( vec3_t startpos , vec3_t end , int type , int dlkey , trailstate_t * * tsk ) ;
2008-11-09 22:29:28 +00:00
int ( * RunParticleEffectState ) ( vec3_t org , vec3_t dir , float count , int typenum , trailstate_t * * tsk ) ;
void ( * RunParticleWeather ) ( vec3_t minb , vec3_t maxb , vec3_t dir , float count , int colour , char * efname ) ;
2013-12-29 22:48:28 +00:00
void ( * RunParticleCube ) ( int typenum , vec3_t minb , vec3_t maxb , vec3_t dir_min , vec3_t dir_max , float count , int colour , qboolean gravity , float jitter ) ; //typenum may be P_INVALID
2008-11-09 22:29:28 +00:00
void ( * RunParticleEffect ) ( vec3_t org , vec3_t dir , int color , int count ) ;
void ( * RunParticleEffect2 ) ( vec3_t org , vec3_t dmin , vec3_t dmax , int color , int effect , int count ) ;
void ( * RunParticleEffect3 ) ( vec3_t org , vec3_t box , int color , int effect , int count ) ;
void ( * RunParticleEffect4 ) ( vec3_t org , float radius , int color , int effect , int count ) ;
void ( * ParticleTrailIndex ) ( vec3_t start , vec3_t end , int color , int crnd , trailstate_t * * tsk ) ;
2010-12-18 17:02:47 +00:00
void ( * EmitSkyEffectTris ) ( struct model_s * mod , struct msurface_s * fa , int ptype ) ;
2010-07-11 02:22:39 +00:00
qboolean ( * InitParticles ) ( void ) ;
2008-11-09 22:29:28 +00:00
void ( * ShutdownParticles ) ( void ) ;
void ( * DelinkTrailstate ) ( trailstate_t * * tsk ) ;
void ( * ClearParticles ) ( void ) ;
void ( * DrawParticles ) ( void ) ;
} particleengine_t ;
extern particleengine_t * pe ;
2004-08-23 00:15:46 +00:00
# endif