1
0
Fork 0
forked from fte/fteqw
fteqw/engine/common/particles.h

150 lines
4.5 KiB
C
Raw Normal View History

#ifndef _PARTICLES_H_
#define _PARTICLES_H_
extern int
pt_gunshot,
ptdp_gunshotquad,
pt_spike,
ptdp_spikequad,
pt_superspike,
ptdp_superspikequad,
pt_wizspike,
pt_knightspike,
pt_explosion,
ptdp_explosionquad,
pt_tarexplosion,
pt_teleportsplash,
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,
rt_rocket,
rt_grenade,
rt_blood,
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;
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
float statetime; // time to emit effect again (used by spawntime field)
} state1;
union {
float laststop; // last stopping point for particle effect
float emittime; // used by r_effect emitters
} state2;
} trailstate_t;
#define PARTICLE_Z_CLIP 8.0
typedef enum { BM_BLEND, BM_BLENDCOLOUR, BM_ADDA, BM_ADDC, BM_SUBTRACT, BM_INVMODA, BM_INVMODC } blendmode_t;
#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)
#define P_INVALID -1
#define P_RunParticleEffectType(a,b,c,d) P_RunParticleEffectState(a,b,c,d,NULL)
// used for callback
extern cvar_t r_particlesdesc;
extern cvar_t r_particlesystem;
struct model_s;
struct msurface_s;
void P_InitParticleSystem(void);
void P_Shutdown(void);
void P_LoadedModel(struct model_s *mod); /*checks a model's various effects*/
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;
rewrote ban code, merging bans+nonbans+cuffs+mute+cripple+deaf+lagged+vip. added timeouts. new penalties have no dedicated command. use the addip command for it. maplist command now generates links. implemented skin objects for q3. added a csqc builtin for it. also supports compositing skins. playing demos inside zips/pk3s/paks should now work. bumped default rate cvar. added cl_transfer to attempt to connect to a new server without disconnecting first. rewrote fog command. alpha and mindist arguments are now supported. fog change also happens over a short time period. added new args to the showpic console command. can now create clickable items for touchscreen/absmouse users. fixed menus to properly support right-aligned text. this finally fixes variable-width fonts. rewrote console tab completion suggestions display. now clickable links. strings obtained from qc are now marked as const. this has required quite a few added consts all over the place. probably crappy attempt at adding joypad support to the sdl port. no idea if it works. changed key bind event code. buttons now track which event they should trigger when released, instead of being the same one the whole time. this allows +forward etc clickable buttons on screen. Also simplified modifier keys - they no longer trigger random events when pressing the modifier key itself. Right modifiers can now be bound separately from left modifiers. Right will use left's binding if not otherwise bound. Bind assumes left if there's no prefix. multiplayer->setup->network menu no longer crashes. added rgb colours to the translation view (but not to the colour-changing keys). added modelviewer command to view models. added menu_mods menu to switch mods in a more friendly way. will be shown by default if multiple manifests exist in the binarydir. clamped classic tracer density. scrag particles no longer look quite so buggy. added ifdefs to facilitate a potential winrt port. the engine should now have no extra dependencies, but still needs system code+audio drivers to be written. if it can't set a renderer, it'll now try to use *every* renderer until it finds one that works. added experimental mapcluster server mode (that console command). New maps will be started up as required. rewrote skeletal blending code a bit. added cylinder geomtypes. fix cfg_save writing to the wrong path bug. VFS_CLOSE now returns a boolean. false means there was some sort of fatal error (either crc when reading was bad, or the write got corrupted or something). Typically ignorable, depends how robust you want to be. win32 tls code now supports running as a server. added connect tls://address support, as well as equivalent sv_addport support. exposed basic model loading api to plugins. d3d11 backend now optionally supports tessellation hlsl. no suitable hlsl provided by default. !!tess to enable. attempted to add gamma ramp support for d3d11. added support for shader blobs to speed up load times. r_shaderblobs 1 to enable. almost vital for d3d11. added vid_srgb cvar. shadowless lights are no longer disabled if shadows are not supported. attempt to add support for touchscreens in win7/8. Wrote gimmicky lua support, using lua instead of ssqc. define VM_LUA to enable. updated saved game code. can again load saved games from vanilla-like engines. changed scale clamping. 0.0001 should no longer appear as 1. changed default mintic from 0.03 to 0.013 to match vanilla qw. I don't know why it was at 0.03. probably a typo. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4623 fc73d0e0-1445-4013-8a0c-d673dee63da5
2014-03-30 08:55:06 +00:00
int (*FindParticleType) (const char *name);
qboolean (*ParticleQuery) (int type, int body, char *outstr, int outstrlen);
int (*RunParticleEffectTypeString) (vec3_t org, vec3_t dir, float count, char *name);
int (*ParticleTrail) (vec3_t startpos, vec3_t end, int type, int dlkey, trailstate_t **tsk);
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);
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
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);
void (*EmitSkyEffectTris) (struct model_s *mod, struct msurface_s *fa, int ptype);
qboolean (*InitParticles) (void);
void (*ShutdownParticles) (void);
void (*DelinkTrailstate) (trailstate_t **tsk);
void (*ClearParticles) (void);
void (*DrawParticles) (void);
} particleengine_t;
extern particleengine_t *pe;
#endif