DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
cl_particles.h File Reference
#include "qtypes.h"
+ Include dependency graph for cl_particles.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  particle_t
 
struct  particletype_t
 

Enumerations

enum  effectnameindex_t {
  EFFECT_NONE , EFFECT_TE_GUNSHOT , EFFECT_TE_GUNSHOTQUAD , EFFECT_TE_SPIKE ,
  EFFECT_TE_SPIKEQUAD , EFFECT_TE_SUPERSPIKE , EFFECT_TE_SUPERSPIKEQUAD , EFFECT_TE_WIZSPIKE ,
  EFFECT_TE_KNIGHTSPIKE , EFFECT_TE_EXPLOSION , EFFECT_TE_EXPLOSIONQUAD , EFFECT_TE_TAREXPLOSION ,
  EFFECT_TE_TELEPORT , EFFECT_TE_LAVASPLASH , EFFECT_TE_SMALLFLASH , EFFECT_TE_FLAMEJET ,
  EFFECT_EF_FLAME , EFFECT_TE_BLOOD , EFFECT_TE_SPARK , EFFECT_TE_PLASMABURN ,
  EFFECT_TE_TEI_G3 , EFFECT_TE_TEI_SMOKE , EFFECT_TE_TEI_BIGEXPLOSION , EFFECT_TE_TEI_PLASMAHIT ,
  EFFECT_EF_STARDUST , EFFECT_TR_ROCKET , EFFECT_TR_GRENADE , EFFECT_TR_BLOOD ,
  EFFECT_TR_WIZSPIKE , EFFECT_TR_SLIGHTBLOOD , EFFECT_TR_KNIGHTSPIKE , EFFECT_TR_VORESPIKE ,
  EFFECT_TR_NEHAHRASMOKE , EFFECT_TR_NEXUIZPLASMA , EFFECT_TR_GLOWTRAIL , EFFECT_SVC_PARTICLE ,
  EFFECT_TOTAL
}
 
enum  pblend_t { PBLEND_ALPHA = 0 , PBLEND_ADD = 1 , PBLEND_INVMOD = 2 , PBLEND_INVALID = -1 }
 
enum  porientation_t {
  PARTICLE_BILLBOARD = 0 , PARTICLE_SPARK = 1 , PARTICLE_ORIENTED_DOUBLESIDED = 2 , PARTICLE_VBEAM = 3 ,
  PARTICLE_HBEAM = 4 , PARTICLE_INVALID = -1
}
 
enum  ptype_t {
  pt_dead , pt_alphastatic , pt_static , pt_spark ,
  pt_beam , pt_rain , pt_raindecal , pt_snow ,
  pt_bubble , pt_blood , pt_smoke , pt_decal ,
  pt_entityparticle , pt_explode , pt_explode2 , pt_total
}
 

Functions

void CL_EntityParticles (const struct entity_s *ent)
 
particle_tCL_NewParticle (const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qbool pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4])
 Creates a new particle and returns a pointer to it.
 
particle_tCL_NewQuakeParticle (const vec3_t origin, const unsigned short ptypeindex, const int color_1, const int color_2, const float gravity, const float offset_x, const float offset_y, const float offset_z, const float velocity_offset_x, const float velocity_offset_y, const float velocity_offset_z, const float air_friction, const float liquid_friction, const float origin_jitter, const float velocity_jitter, const float lifetime)
 Creates a simple particle, a square like Quake, or a disc like GLQuake.
 
void CL_ParseParticleEffect (void)
 
void CL_ParticleBox (int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
 
void CL_ParticleCube (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, vec_t gravity, vec_t randomvel)
 
void CL_ParticleEffect (int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor)
 
int CL_ParticleEffectIndexForName (const char *name)
 
const char * CL_ParticleEffectNameForIndex (int i)
 
void CL_ParticleExplosion (const vec3_t org)
 
void CL_ParticleExplosion2 (const vec3_t org, int colorStart, int colorLength)
 
void CL_ParticleRain (const vec3_t mins, const vec3_t maxs, const vec3_t dir, int count, int colorbase, int type)
 
void CL_Particles_Clear (void)
 
void CL_Particles_Init (void)
 
void CL_Particles_Shutdown (void)
 
void CL_ParticleTrail (int effectindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, struct entity_s *ent, int palettecolor, qbool spawndlight, qbool spawnparticles, float tintmins[4], float tintmaxs[4], float fade)
 

Variables

struct cvar_s cl_decals
 
struct cvar_s cl_decals_fadetime
 
struct cvar_s cl_decals_time
 
struct cvar_s cl_particles
 
struct cvar_s cl_particles_blood
 
struct cvar_s cl_particles_blood_alpha
 
struct cvar_s cl_particles_blood_bloodhack
 
struct cvar_s cl_particles_blood_decal_alpha
 
struct cvar_s cl_particles_blood_decal_scalemax
 
struct cvar_s cl_particles_blood_decal_scalemin
 
struct cvar_s cl_particles_bubbles
 
struct cvar_s cl_particles_bulletimpacts
 
struct cvar_s cl_particles_explosions_shell
 
struct cvar_s cl_particles_explosions_sparks
 
struct cvar_s cl_particles_quake
 
struct cvar_s cl_particles_quality
 
struct cvar_s cl_particles_rain
 
struct cvar_s cl_particles_size
 
struct cvar_s cl_particles_smoke
 
struct cvar_s cl_particles_smoke_alpha
 
struct cvar_s cl_particles_smoke_alphafade
 
struct cvar_s cl_particles_snow
 
struct cvar_s cl_particles_sparks
 

Enumeration Type Documentation

◆ effectnameindex_t

Enumerator
EFFECT_NONE 
EFFECT_TE_GUNSHOT 
EFFECT_TE_GUNSHOTQUAD 
EFFECT_TE_SPIKE 
EFFECT_TE_SPIKEQUAD 
EFFECT_TE_SUPERSPIKE 
EFFECT_TE_SUPERSPIKEQUAD 
EFFECT_TE_WIZSPIKE 
EFFECT_TE_KNIGHTSPIKE 
EFFECT_TE_EXPLOSION 
EFFECT_TE_EXPLOSIONQUAD 
EFFECT_TE_TAREXPLOSION 
EFFECT_TE_TELEPORT 
EFFECT_TE_LAVASPLASH 
EFFECT_TE_SMALLFLASH 
EFFECT_TE_FLAMEJET 
EFFECT_EF_FLAME 
EFFECT_TE_BLOOD 
EFFECT_TE_SPARK 
EFFECT_TE_PLASMABURN 
EFFECT_TE_TEI_G3 
EFFECT_TE_TEI_SMOKE 
EFFECT_TE_TEI_BIGEXPLOSION 
EFFECT_TE_TEI_PLASMAHIT 
EFFECT_EF_STARDUST 
EFFECT_TR_ROCKET 
EFFECT_TR_GRENADE 
EFFECT_TR_BLOOD 
EFFECT_TR_WIZSPIKE 
EFFECT_TR_SLIGHTBLOOD 
EFFECT_TR_KNIGHTSPIKE 
EFFECT_TR_VORESPIKE 
EFFECT_TR_NEHAHRASMOKE 
EFFECT_TR_NEXUIZPLASMA 
EFFECT_TR_GLOWTRAIL 
EFFECT_SVC_PARTICLE 
EFFECT_TOTAL 

Definition at line 128 of file cl_particles.h.

129{
167}
@ EFFECT_TE_WIZSPIKE
@ EFFECT_TR_GLOWTRAIL
@ EFFECT_TE_TEI_SMOKE
@ EFFECT_EF_STARDUST
@ EFFECT_TE_FLAMEJET
@ EFFECT_TR_SLIGHTBLOOD
@ EFFECT_TE_SUPERSPIKEQUAD
@ EFFECT_TE_SPIKEQUAD
@ EFFECT_TE_SPARK
@ EFFECT_TR_WIZSPIKE
@ EFFECT_TE_GUNSHOTQUAD
@ EFFECT_TE_EXPLOSIONQUAD
@ EFFECT_TE_EXPLOSION
@ EFFECT_TR_NEHAHRASMOKE
@ EFFECT_TR_ROCKET
@ EFFECT_SVC_PARTICLE
@ EFFECT_TE_GUNSHOT
@ EFFECT_TR_VORESPIKE
@ EFFECT_TR_GRENADE
@ EFFECT_TE_PLASMABURN
@ EFFECT_TE_TAREXPLOSION
@ EFFECT_TR_BLOOD
@ EFFECT_EF_FLAME
@ EFFECT_TE_LAVASPLASH
@ EFFECT_TE_TELEPORT
@ EFFECT_TE_SMALLFLASH
@ EFFECT_TE_KNIGHTSPIKE
@ EFFECT_TE_BLOOD
@ EFFECT_TE_TEI_PLASMAHIT
@ EFFECT_TR_NEXUIZPLASMA
@ EFFECT_TE_SUPERSPIKE
@ EFFECT_TE_TEI_G3
@ EFFECT_TR_KNIGHTSPIKE
@ EFFECT_NONE
@ EFFECT_TOTAL
@ EFFECT_TE_TEI_BIGEXPLOSION
@ EFFECT_TE_SPIKE

◆ pblend_t

enum pblend_t
Enumerator
PBLEND_ALPHA 
PBLEND_ADD 
PBLEND_INVMOD 
PBLEND_INVALID 

Definition at line 42 of file cl_particles.h.

43{
44 PBLEND_ALPHA = 0,
45 PBLEND_ADD = 1,
46 PBLEND_INVMOD = 2,
48}
@ PBLEND_ALPHA
@ PBLEND_ADD
@ PBLEND_INVMOD
@ PBLEND_INVALID

◆ porientation_t

Enumerator
PARTICLE_BILLBOARD 
PARTICLE_SPARK 
PARTICLE_ORIENTED_DOUBLESIDED 
PARTICLE_VBEAM 
PARTICLE_HBEAM 
PARTICLE_INVALID 

Definition at line 31 of file cl_particles.h.

32{
39}
@ PARTICLE_SPARK
@ PARTICLE_HBEAM
@ PARTICLE_BILLBOARD
@ PARTICLE_VBEAM
@ PARTICLE_ORIENTED_DOUBLESIDED
@ PARTICLE_INVALID

◆ ptype_t

enum ptype_t
Enumerator
pt_dead 
pt_alphastatic 
pt_static 
pt_spark 
pt_beam 
pt_rain 
pt_raindecal 
pt_snow 
pt_bubble 
pt_blood 
pt_smoke 
pt_decal 
pt_entityparticle 
pt_explode 
pt_explode2 
pt_total 

Definition at line 59 of file cl_particles.h.

60{
61 pt_dead,
65 pt_beam,
66 pt_rain,
68 pt_snow,
74 pt_explode, // used for Quake-style explosion particle colour ramping
75 pt_explode2, // used for Quake-style explosion particle colour ramping
77}
@ pt_snow
@ pt_blood
@ pt_total
@ pt_spark
@ pt_explode2
@ pt_dead
@ pt_bubble
@ pt_static
@ pt_beam
@ pt_alphastatic
@ pt_raindecal
@ pt_entityparticle
@ pt_rain
@ pt_explode
@ pt_smoke
@ pt_decal

Function Documentation

◆ CL_EntityParticles()

void CL_EntityParticles ( const struct entity_s * ent)

◆ CL_NewParticle()

particle_t * CL_NewParticle ( const vec3_t sortorigin,
unsigned short ptypeindex,
int pcolor1,
int pcolor2,
int ptex,
float psize,
float psizeincrease,
float palpha,
float palphafade,
float pgravity,
float pbounce,
float px,
float py,
float pz,
float pvx,
float pvy,
float pvz,
float pairfriction,
float pliquidfriction,
float originjitter,
float velocityjitter,
qbool pqualityreduction,
float lifetime,
float stretch,
pblend_t blendmode,
porientation_t orientation,
int staincolor1,
int staincolor2,
int staintex,
float stainalpha,
float stainsize,
float angle,
float spin,
float tint[4] )

Creates a new particle and returns a pointer to it.

Parameters
[in]sortorigin?
[in]ptypeindexAny of the pt_ enum values (pt_static, pt_blood, etc), see ptype_t near the top of this file
[in]pcolor1,pcolor2Minimum and maximum range of color, randomly interpolated with pcolor2 to decide particle color
[in]ptexAny of the tex_ values such as tex_smoke[rand()&7] or tex_particle
[in]psizeSize of particle (or thickness for PARTICLE_SPARK and PARTICLE_*BEAM)
[in]psizeincrease?
[in]palphaOpacity of particle as 0-255 (can be more than 255)
[in]palphafadeRate of fade per second (so 256 would mean a 256 alpha particle would fade to nothing in 1 second)
[in]pgravityHow much effect gravity has on the particle (0-1)
[in]pbounceHow much bounce the particle has when it hits a surface (0-1), -1 makes a blood splat when it hits a surface, 0 does not even check for collisions
[in]px,py,pzStarting origin of particle
[in]pvx,pvy,pvzStarting velocity of particle
[in]pairfrictionHow much the particle slows down, in air, per second (0-1 typically, can slowdown faster than 1)
[in]pliquidfrictionHow much the particle slows down, in liquids, per second (0-1 typically, can slowdown faster than 1)
[in]originjitter?
[in]velocityjitter?
[in]pqualityreduction?
[in]lifetimeHow long the particle can live (note it is also removed if alpha drops to nothing)
[in]stretch?
[in]blendmodeOne of the PBLEND_ values
[in]orientationOne of the PARTICLE_ values
[in]staincolor1Minimum and maximum ranges of stain color, randomly interpolated to decide stain color (-1 to use none)
[in]staincolor2Minimum and maximum ranges of stain color, randomly interpolated to decide stain color (-1 to use none)
[in]staintexAny of the tex_ values such as tex_smoke[rand()&7] or tex_particle
[in]angleBase rotation of the particle geometry around its center normal
[in]spinRotation speed of the particle geometry around its center normal
[in]tintThe tint
Returns
Pointer to the new particle

Definition at line 668 of file cl_particles.c.

698{
699 int l1, l2, r, g, b;
700 particle_t *part;
701 vec3_t v;
703 return NULL;
706 return NULL;
707 if (!lifetime)
708 lifetime = palpha / min(1, palphafade);
709 part = &cl.particles[cl.free_particle++];
712 memset(part, 0, sizeof(*part));
713 VectorCopy(sortorigin, part->sortorigin);
714 part->typeindex = ptypeindex;
715 part->blendmode = blendmode;
716 if(orientation == PARTICLE_HBEAM || orientation == PARTICLE_VBEAM)
717 {
719 if(tex->t1 == 0 && tex->t2 == 1) // full height of texture?
721 else
723 }
724 else
725 part->orientation = orientation;
726 l2 = (int)lhrandom(0.5, 256.5);
727 l1 = 256 - l2;
728 part->color[0] = ((((pcolor1 >> 16) & 0xFF) * l1 + ((pcolor2 >> 16) & 0xFF) * l2) >> 8) & 0xFF;
729 part->color[1] = ((((pcolor1 >> 8) & 0xFF) * l1 + ((pcolor2 >> 8) & 0xFF) * l2) >> 8) & 0xFF;
730 part->color[2] = ((((pcolor1 >> 0) & 0xFF) * l1 + ((pcolor2 >> 0) & 0xFF) * l2) >> 8) & 0xFF;
731 if (vid.sRGB3D)
732 {
733 part->color[0] = (unsigned char)floor(Image_LinearFloatFromsRGB(part->color[0]) * 255.0f + 0.5f);
734 part->color[1] = (unsigned char)floor(Image_LinearFloatFromsRGB(part->color[1]) * 255.0f + 0.5f);
735 part->color[2] = (unsigned char)floor(Image_LinearFloatFromsRGB(part->color[2]) * 255.0f + 0.5f);
736 }
737 part->alpha = palpha;
738 part->alphafade = palphafade;
739 part->staintexnum = staintex;
740 if(staincolor1 >= 0 && staincolor2 >= 0)
741 {
742 l2 = (int)lhrandom(0.5, 256.5);
743 l1 = 256 - l2;
744 if(blendmode == PBLEND_INVMOD)
745 {
746 r = ((((staincolor1 >> 16) & 0xFF) * l1 + ((staincolor2 >> 16) & 0xFF) * l2) * (255 - part->color[0])) / 0x8000; // staincolor 0x808080 keeps color invariant
747 g = ((((staincolor1 >> 8) & 0xFF) * l1 + ((staincolor2 >> 8) & 0xFF) * l2) * (255 - part->color[1])) / 0x8000;
748 b = ((((staincolor1 >> 0) & 0xFF) * l1 + ((staincolor2 >> 0) & 0xFF) * l2) * (255 - part->color[2])) / 0x8000;
749 }
750 else
751 {
752 r = ((((staincolor1 >> 16) & 0xFF) * l1 + ((staincolor2 >> 16) & 0xFF) * l2) * part->color[0]) / 0x8000; // staincolor 0x808080 keeps color invariant
753 g = ((((staincolor1 >> 8) & 0xFF) * l1 + ((staincolor2 >> 8) & 0xFF) * l2) * part->color[1]) / 0x8000;
754 b = ((((staincolor1 >> 0) & 0xFF) * l1 + ((staincolor2 >> 0) & 0xFF) * l2) * part->color[2]) / 0x8000;
755 }
756 if(r > 0xFF) r = 0xFF;
757 if(g > 0xFF) g = 0xFF;
758 if(b > 0xFF) b = 0xFF;
759 }
760 else
761 {
762 r = part->color[0]; // -1 is shorthand for stain = particle color
763 g = part->color[1];
764 b = part->color[2];
765 }
766 part->staincolor[0] = r;
767 part->staincolor[1] = g;
768 part->staincolor[2] = b;
769 part->stainalpha = palpha * stainalpha;
770 part->stainsize = psize * stainsize;
771 if(tint)
772 {
773 if(blendmode != PBLEND_INVMOD) // invmod is immune to tinting
774 {
775 part->color[0] *= tint[0];
776 part->color[1] *= tint[1];
777 part->color[2] *= tint[2];
778 }
779 part->alpha *= tint[3];
780 part->alphafade *= tint[3];
781 part->stainalpha *= tint[3];
782 }
783 part->texnum = ptex;
784 part->size = psize;
785 part->sizeincrease = psizeincrease;
786 part->gravity = pgravity;
787 part->bounce = pbounce;
788 part->stretch = stretch;
790 part->org[0] = px + originjitter * v[0];
791 part->org[1] = py + originjitter * v[1];
792 part->org[2] = pz + originjitter * v[2];
793 part->vel[0] = pvx + velocityjitter * v[0];
794 part->vel[1] = pvy + velocityjitter * v[1];
795 part->vel[2] = pvz + velocityjitter * v[2];
796 part->airfriction = pairfriction;
797 part->liquidfriction = pliquidfriction;
798 part->die = cl.time + lifetime;
799 part->delayedspawn = cl.time;
800// part->delayedcollisions = 0;
801 part->qualityreduction = pqualityreduction;
802 part->angle = angle;
803 part->spin = spin;
804 // if it is rain or snow, trace ahead and shut off collisions until an actual collision event needs to occur to improve performance
805 if (part->typeindex == pt_rain)
806 {
807 int i;
808 particle_t *part2;
809 vec3_t endvec;
810 trace_t trace;
811 // turn raindrop into simple spark and create delayedspawn splash effect
812 part->typeindex = pt_spark;
813 part->bounce = 0;
814 VectorMA(part->org, lifetime, part->vel, endvec);
815 trace = CL_TraceLine(part->org, endvec, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_LIQUIDSMASK, 0, 0, collision_extendmovelength.value, true, false, NULL, false, false);
816 part->die = cl.time + lifetime * trace.fraction;
817 part2 = CL_NewParticle(endvec, pt_raindecal, pcolor1, pcolor2, tex_rainsplash, part->size, part->size * 20, part->alpha, part->alpha / 0.4, 0, 0, trace.endpos[0] + trace.plane.normal[0], trace.endpos[1] + trace.plane.normal[1], trace.endpos[2] + trace.plane.normal[2], trace.plane.normal[0], trace.plane.normal[1], trace.plane.normal[2], 0, 0, 0, 0, pqualityreduction, 0, 1, PBLEND_ADD, PARTICLE_ORIENTED_DOUBLESIDED, -1, -1, -1, 1, 1, 0, 0, NULL);
818 if (part2)
819 {
820 part2->delayedspawn = part->die;
821 part2->die += part->die - cl.time;
822 for (i = rand() & 7;i < 10;i++)
823 {
824 part2 = CL_NewParticle(endvec, pt_spark, pcolor1, pcolor2, tex_particle, 0.25f, 0, part->alpha * 2, part->alpha * 4, 1, 0.1, trace.endpos[0] + trace.plane.normal[0], trace.endpos[1] + trace.plane.normal[1], trace.endpos[2] + trace.plane.normal[2], trace.plane.normal[0] * 16, trace.plane.normal[1] * 16, trace.plane.normal[2] * 16 + cl.movevars_gravity * 0.04, 0, 0, 0, 32, pqualityreduction, 0, 1, PBLEND_ADD, PARTICLE_SPARK, -1, -1, -1, 1, 1, 0, 0, NULL);
825 if (part2)
826 {
827 part2->delayedspawn = part->die;
828 part2->die += part->die - cl.time;
829 }
830 }
831 }
832 }
833 else if (part->typeindex == pt_explode || part->typeindex == pt_explode2)
834 part->time2 = rand()&3; // time2 is used to progress the colour ramp index
835
836#if 0
837 else if (part->bounce != 0 && part->gravity == 0 && part->typeindex != pt_snow)
838 {
839 float lifetime = part->alpha / (part->alphafade ? part->alphafade : 1);
840 vec3_t endvec;
841 trace_t trace;
842 VectorMA(part->org, lifetime, part->vel, endvec);
843 trace = CL_TraceLine(part->org, endvec, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY, true, false, NULL, false);
844 part->delayedcollisions = cl.time + lifetime * trace.fraction - 0.1;
845 }
846#endif
847
848 return part;
849}
#define SUPERCONTENTS_BODY
Definition bspfile.h:201
#define SUPERCONTENTS_SOLID
Definition bspfile.h:196
#define SUPERCONTENTS_LIQUIDSMASK
Definition bspfile.h:218
trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces)
client_state_t cl
Definition cl_main.c:117
particle_t * CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, int pcolor1, int pcolor2, int ptex, float psize, float psizeincrease, float palpha, float palphafade, float pgravity, float pbounce, float px, float py, float pz, float pvx, float pvy, float pvz, float pairfriction, float pliquidfriction, float originjitter, float velocityjitter, qbool pqualityreduction, float lifetime, float stretch, pblend_t blendmode, porientation_t orientation, int staincolor1, int staincolor2, int staintex, float stainalpha, float stainsize, float angle, float spin, float tint[4])
Creates a new particle and returns a pointer to it.
cvar_t cl_particles
static const int tex_rainsplash
static const int tex_particle
static particletexture_t particletexture[MAX_PARTICLETEXTURES]
cvar_t collision_extendmovelength
Definition collision.c:14
static int(ZEXPORT *qz_inflate)(z_stream *strm
const GLdouble * v
Definition glquake.h:762
#define Image_LinearFloatFromsRGB(c)
Definition image.h:69
#define VectorRandom(v)
Definition mathlib.h:119
#define min(A, B)
Definition mathlib.h:37
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
Definition mathlib.h:48
#define VectorCopy(in, out)
Definition mathlib.h:101
#define VectorMA(a, scale, b, out)
Definition mathlib.h:114
float floor(float f)
int i
#define NULL
Definition qtypes.h:12
vec_t vec3_t[3]
Definition qtypes.h:71
dp_FragColor r
dp_FragColor g
dp_FragColor b
vec2 px
particle_t * particles
Definition client.h:1000
float movevars_gravity
Definition client.h:1059
int free_particle
Definition client.h:1015
double time
Definition client.h:868
int num_particles
Definition client.h:1009
int max_particles
Definition client.h:988
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
unsigned char staincolor[3]
unsigned char typeindex
float alphafade
how much alpha reduces per second
unsigned char texnum
float stretch
only for sparks
float die
time when this particle should be removed, regardless of alpha
float bounce
how much bounce-back from a surface the particle hits (0 = no physics, 1 = stop and slide,...
float airfriction
how much air friction affects this object (objects with a low mass/size ratio tend to get more air fr...
unsigned char orientation
float gravity
how much gravity affects this particle (1.0 = normal gravity, 0.0 = none)
float stainsize
vec3_t vel
velocity of particle, or orientation of decal, or end point of beam
vec3_t sortorigin
sort by this group origin, not particle org
float alpha
0-255
unsigned char qualityreduction
enables skipping of this particle according to r_refdef.view.qualityreduction
float sizeincrease
rate of size change per second
signed char staintexnum
float liquidfriction
how much liquid friction affects this object (objects with a low mass/size ratio tend to get more liq...
unsigned char blendmode
float delayedspawn
time that particle appears and begins moving
unsigned char color[3]
float stainalpha
float time2
used for snow fluttering, decal fade, explosion colour ramp
short spin
geometry rotation speed around the particle center normal
short angle
base rotation of particle
double fraction
Definition collision.h:40
double endpos[3]
Definition collision.h:42
plane_t plane
Definition collision.h:44
qbool sRGB3D
whether 3D rendering is sRGB corrected (based on sRGBcapable3D)
Definition vid.h:76
vec3_t normal
Definition collision.h:13
viddef_t vid
global video state
Definition vid_shared.c:64
#define MOVE_NOMONSTERS
Definition world.h:29

References particle_t::airfriction, particle_t::alpha, particle_t::alphafade, particle_t::angle, b, particle_t::blendmode, particle_t::bounce, cl, CL_NewParticle(), cl_particles, CL_TraceLine(), collision_extendmovelength, particle_t::color, particle_t::delayedspawn, particle_t::die, trace_t::endpos, floor(), trace_t::fraction, client_state_t::free_particle, g, particle_t::gravity, i, Image_LinearFloatFromsRGB, int(), cvar_t::integer, lhrandom, particle_t::liquidfriction, client_state_t::max_particles, min, MOVE_NOMONSTERS, client_state_t::movevars_gravity, plane_t::normal, NULL, client_state_t::num_particles, particle_t::org, particle_t::orientation, PARTICLE_HBEAM, PARTICLE_ORIENTED_DOUBLESIDED, PARTICLE_SPARK, PARTICLE_VBEAM, client_state_t::particles, particletexture, PBLEND_ADD, PBLEND_INVMOD, trace_t::plane, pt_explode, pt_explode2, pt_rain, pt_raindecal, pt_snow, pt_spark, px, particle_t::qualityreduction, r, particle_t::size, particle_t::sizeincrease, particle_t::sortorigin, particle_t::spin, viddef_t::sRGB3D, particle_t::stainalpha, particle_t::staincolor, particle_t::stainsize, particle_t::staintexnum, particle_t::stretch, SUPERCONTENTS_BODY, SUPERCONTENTS_LIQUIDSMASK, SUPERCONTENTS_SOLID, particletexture_t::t1, particletexture_t::t2, tex_particle, tex_rainsplash, particle_t::texnum, client_state_t::time, particle_t::time2, particle_t::typeindex, v, cvar_t::value, VectorCopy, VectorMA, VectorRandom, particle_t::vel, and vid.

Referenced by CL_EntityParticles(), CL_NewParticle(), CL_NewParticlesFromEffectinfo(), CL_NewQuakeParticle(), CL_ParticleCube(), CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), CL_ParticleExplosion2(), CL_ParticleRain(), CL_ReadPointFile_f(), CL_Smoke(), CL_Sparks(), VM_CL_SpawnParticle(), and VM_CL_SpawnParticleDelayed().

◆ CL_NewQuakeParticle()

particle_t * CL_NewQuakeParticle ( const vec3_t origin,
const unsigned short ptypeindex,
const int color_1,
const int color_2,
const float gravity,
const float offset_x,
const float offset_y,
const float offset_z,
const float velocity_offset_x,
const float velocity_offset_y,
const float velocity_offset_z,
const float air_friction,
const float liquid_friction,
const float origin_jitter,
const float velocity_jitter,
const float lifetime )

Creates a simple particle, a square like Quake, or a disc like GLQuake.

Parameters
[in]origin?
[in]color_1,color_2Minimum and maximum range of color, randomly interpolated with pcolor2 to decide particle color
[in]gravityHow much effect gravity has on the particle (0-1)
[in]offset_x,offset_y,offset_zStarting origin of particle
[in]velocity_offset_x,velocity_offset_y,velocity_offset_zStarting velocity of particle
[in]air_frictionHow much the particle slows down, in air, per second (0-1 typically, can slowdown faster than 1)
[in]liquid_frictionHow much the particle slows down, in liquids, per second (0-1 typically, can slowdown faster than 1)
[in]origin_jitter?
[in]velocity_jitter?
[in]lifetimeHow long the particle can live (note it is also removed if alpha drops to nothing)
Returns
Pointer to the new particle

Definition at line 869 of file cl_particles.c.

886{
887 int texture;
888
889 // Set the particle texture based on the value of cl_particles_quake; defaulting to the GLQuake disc
892 else
894
895 return CL_NewParticle(
896 origin,
897 ptypeindex, // type
898 color_1,
899 color_2,
900 texture,
901 0.8f, // size
902 0, // size increase
903 255, // alpha
904 0, // alpha fade
905 gravity,
906 0, // bounce
907 offset_x,
908 offset_y,
909 offset_z,
910 velocity_offset_x,
911 velocity_offset_y,
912 velocity_offset_z,
913 air_friction,
914 liquid_friction,
915 origin_jitter,
916 velocity_jitter,
917 true, // quality reduction
918 lifetime,
919 1, // stretch
920 PBLEND_ALPHA, // blend mode
921 PARTICLE_BILLBOARD, // orientation
922 -1, // stain color 1
923 -1, // stain color 2
924 -1, // stain texture
925 1, // stain alpha
926 1, // stain size
927 0, // angle
928 0, // spin
929 NULL // tint
930 );
931}
cvar_t cl_particles_quake
static const int tex_square
vector origin
GLenum GLenum GLuint texture
Definition glquake.h:613

References CL_NewParticle(), cl_particles_quake, cvar_t::integer, NULL, origin, PARTICLE_BILLBOARD, PBLEND_ALPHA, tex_particle, tex_square, and texture.

Referenced by CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), and CL_ParticleExplosion2().

◆ CL_ParseParticleEffect()

void CL_ParseParticleEffect ( void )

Definition at line 1914 of file cl_particles.c.

1915{
1916 vec3_t org, dir;
1917 int i, count, msgcount, color;
1918
1920 for (i=0 ; i<3 ; i++)
1921 dir[i] = MSG_ReadChar(&cl_message) * (1.0 / 16.0);
1922 msgcount = MSG_ReadByte(&cl_message);
1924
1925 if (msgcount == 255)
1926 count = 1024;
1927 else
1928 count = msgcount;
1929
1931}
client_static_t cls
Definition cl_main.c:116
void CL_ParticleEffect(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor)
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
Definition com_msg.c:401
#define MSG_ReadChar(sb)
Definition common.h:187
#define MSG_ReadByte(sb)
Definition common.h:188
vector color
GLenum GLenum GLsizei count
Definition glquake.h:656
sizebuf_t cl_message
Definition netconn.c:71
vec2 dir
protocolversion_t protocol
Definition client.h:617

References cl_message, CL_ParticleEffect(), cls, color, count, dir, EFFECT_SVC_PARTICLE, i, MSG_ReadByte, MSG_ReadChar, MSG_ReadVector(), NULL, and client_static_t::protocol.

Referenced by CL_ParseServerMessage().

◆ CL_ParticleBox()

void CL_ParticleBox ( int effectindex,
float pcount,
const vec3_t originmins,
const vec3_t originmaxs,
const vec3_t velocitymins,
const vec3_t velocitymaxs,
struct entity_s * ent,
int palettecolor,
qbool spawndlight,
qbool spawnparticles,
float tintmins[4],
float tintmaxs[4],
float fade )

◆ CL_ParticleCube()

void CL_ParticleCube ( const vec3_t mins,
const vec3_t maxs,
const vec3_t dir,
int count,
int colorbase,
vec_t gravity,
vec_t randomvel )

Definition at line 2073 of file cl_particles.c.

2074{
2075 vec3_t center;
2076 int k;
2077 if (!cl_particles.integer) return;
2078 VectorMAM(0.5f, mins, 0.5f, maxs, center);
2079
2081 while (count--)
2082 {
2083 k = particlepalette[colorbase + (rand()&3)];
2084 CL_NewParticle(center, pt_alphastatic, k, k, tex_particle, 2, 0, 255, 128, gravity, 0, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(mins[2], maxs[2]), dir[0], dir[1], dir[2], 0, 0, 0, randomvel, true, 0, 1, PBLEND_ALPHA, PARTICLE_BILLBOARD, -1, -1, -1, 1, 1, 0, 0, NULL);
2085 }
2086}
static int particlepalette[256]
cvar_t cl_particles_quality
vector mins
vector maxs
#define VectorMAM(scale1, b1, scale2, b2, out)
Definition mathlib.h:116

References CL_NewParticle(), cl_particles, cl_particles_quality, count, dir, int(), cvar_t::integer, lhrandom, maxs, mins, NULL, PARTICLE_BILLBOARD, particlepalette, PBLEND_ALPHA, pt_alphastatic, tex_particle, cvar_t::value, and VectorMAM.

Referenced by CL_ParseTempEntity(), and VM_CL_te_particlecube().

◆ CL_ParticleEffect()

void CL_ParticleEffect ( int effectindex,
float pcount,
const vec3_t originmins,
const vec3_t originmaxs,
const vec3_t velocitymins,
const vec3_t velocitymaxs,
struct entity_s * ent,
int palettecolor )

◆ CL_ParticleEffectIndexForName()

int CL_ParticleEffectIndexForName ( const char * name)

Definition at line 481 of file cl_particles.c.

482{
483 int i;
484 for (i = 1;i < MAX_PARTICLEEFFECTNAME && particleeffectname[i][0];i++)
485 if (!strcmp(particleeffectname[i], name))
486 return i;
487 return 0;
488}
char particleeffectname[MAX_PARTICLEEFFECTNAME][64]
const GLchar * name
Definition glquake.h:601
#define MAX_PARTICLEEFFECTNAME
maximum number of unique names of particle effects (for particleeffectnum)
Definition qdefs.h:135

References i, MAX_PARTICLEEFFECTNAME, name, and particleeffectname.

Referenced by VM_CL_particleeffectnum().

◆ CL_ParticleEffectNameForIndex()

const char * CL_ParticleEffectNameForIndex ( int i)

Definition at line 490 of file cl_particles.c.

491{
493 return NULL;
494 return particleeffectname[i];
495}

References i, MAX_PARTICLEEFFECTNAME, NULL, and particleeffectname.

◆ CL_ParticleExplosion()

void CL_ParticleExplosion ( const vec3_t org)

Definition at line 1939 of file cl_particles.c.

1940{
1941 int i;
1942 trace_t trace;
1943
1944 R_Stain(org, 96, 40, 40, 40, 64, 88, 88, 88, 64);
1945 CL_SpawnDecalParticleForPoint(org, 40, 48, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF);
1946
1948 {
1949 for (i = 0; i < 1024; i++)
1950 {
1951 int color;
1952 int r = rand()&3;
1953
1954 if (i & 1)
1955 {
1957
1959 org,
1960 pt_explode,
1961 color, color,
1962 0.05, // gravity
1963 org[0], org[1], org[2], // offset
1964 0, 0, 0, // velocity
1965 2, // air friction
1966 0, // liquid friction
1967 16, // origin jitter
1968 256, // velocity jitter
1969 5 // lifetime
1970 );
1971 }
1972 else
1973 {
1975
1977 org,
1979 color, color,
1980 0.05, // gravity
1981 org[0], org[1], org[2], // offset
1982 0, 0, 0, // velocity
1983 0, // air friction
1984 0, // liquid friction
1985 16, // origin jitter
1986 256, // velocity jitter
1987 5 // lifetime
1988 );
1989 }
1990 }
1991 }
1992 else
1993 {
1994 i = CL_PointSuperContents(org);
1996 {
1998 for (i = 0;i < 128 * cl_particles_quality.value;i++)
1999 CL_NewParticle(org, pt_bubble, 0x404040, 0x808080, tex_bubble, 2, 0, lhrandom(128, 255), 128, -0.125, 1.5, org[0], org[1], org[2], 0, 0, 0, 0.0625, 0.25, 16, 96, true, 0, 1, PBLEND_ADD, PARTICLE_BILLBOARD, -1, -1, -1, 1, 1, 0, 0, NULL);
2000 }
2001 else
2002 {
2004 {
2005 for (i = 0;i < 512 * cl_particles_quality.value;i++)
2006 {
2007 int k = 0;
2008 vec3_t v, v2;
2009 do
2010 {
2012 VectorMA(org, 128, v2, v);
2013 trace = CL_TraceLine(org, v, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID, 0, 0, collision_extendmovelength.value, true, false, NULL, false, false);
2014 }
2015 while (k++ < 16 && trace.fraction < 0.1f);
2016 VectorSubtract(trace.endpos, org, v2);
2017 VectorScale(v2, 2.0f, v2);
2018 CL_NewParticle(org, pt_spark, 0x903010, 0xFFD030, tex_particle, 1.0f, 0, lhrandom(0, 255), 512, 0, 0, org[0], org[1], org[2], v2[0], v2[1], v2[2], 0, 0, 0, 0, true, 0, 1, PBLEND_ADD, PARTICLE_SPARK, -1, -1, -1, 1, 1, 0, 0, NULL);
2019 }
2020 }
2021 }
2022 }
2023
2025 R_NewExplosion(org);
2026}
#define SUPERCONTENTS_SLIME
Definition bspfile.h:198
#define SUPERCONTENTS_WATER
Definition bspfile.h:197
#define CL_PointSuperContents(point)
cvar_t cl_particles_explosions_sparks
int ramp1[8]
cvar_t cl_particles_sparks
static const int tex_bubble
cvar_t cl_particles_explosions_shell
static const int tex_bulletdecal[8]
particle_t * CL_NewQuakeParticle(const vec3_t origin, const unsigned short ptypeindex, const int color_1, const int color_2, const float gravity, const float offset_x, const float offset_y, const float offset_z, const float velocity_offset_x, const float velocity_offset_y, const float velocity_offset_z, const float air_friction, const float liquid_friction, const float origin_jitter, const float velocity_jitter, const float lifetime)
Creates a simple particle, a square like Quake, or a disc like GLQuake.
int ramp2[8]
void CL_SpawnDecalParticleForPoint(const vec3_t org, float maxdist, float size, float alpha, int texnum, int color1, int color2)
cvar_t cl_particles_bubbles
void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2)
Definition gl_rsurf.c:298
GLfloat GLfloat GLfloat v2
Definition glquake.h:747
#define VectorSubtract(a, b, out)
Definition mathlib.h:99
#define VectorScale(in, scale, out)
Definition mathlib.h:111
void R_NewExplosion(const vec3_t org)

References CL_NewParticle(), CL_NewQuakeParticle(), cl_particles, cl_particles_bubbles, cl_particles_explosions_shell, cl_particles_explosions_sparks, cl_particles_quake, cl_particles_quality, cl_particles_sparks, CL_PointSuperContents, CL_SpawnDecalParticleForPoint(), CL_TraceLine(), collision_extendmovelength, color, trace_t::endpos, trace_t::fraction, i, cvar_t::integer, lhrandom, MOVE_NOMONSTERS, NULL, PARTICLE_BILLBOARD, PARTICLE_SPARK, particlepalette, PBLEND_ADD, pt_bubble, pt_explode, pt_explode2, pt_spark, r, R_NewExplosion(), R_Stain(), ramp1, ramp2, SUPERCONTENTS_SLIME, SUPERCONTENTS_SOLID, SUPERCONTENTS_WATER, tex_bubble, tex_bulletdecal, tex_particle, v, v2, cvar_t::value, VectorMA, VectorRandom, VectorScale, and VectorSubtract.

Referenced by CL_ParseTempEntity(), CL_ParticleEffect_Fallback(), and VM_CL_te_explosionrgb().

◆ CL_ParticleExplosion2()

void CL_ParticleExplosion2 ( const vec3_t org,
int colorStart,
int colorLength )

Definition at line 2034 of file cl_particles.c.

2035{
2036 int i, k;
2037 if (!cl_particles.integer) return;
2038
2039 for (i = 0;i < 512 * cl_particles_quality.value;i++)
2040 {
2041 k = particlepalette[colorStart + (i % colorLength)];
2043 CL_NewQuakeParticle(org, pt_alphastatic, k, k, 0, org[0], org[1], org[2], 0, 0, 0, -4, -4, 16, 256, 0.3);
2044 else
2045 CL_NewParticle(org, pt_alphastatic, k, k, tex_particle, lhrandom(0.5, 1.5), 0, 255, 512, 0, 0, org[0], org[1], org[2], 0, 0, 0, lhrandom(1.5, 3), lhrandom(1.5, 3), 8, 192, true, 0, 1, PBLEND_ALPHA, PARTICLE_BILLBOARD, -1, -1, -1, 1, 1, 0, 0, NULL);
2046 }
2047}

References CL_NewParticle(), CL_NewQuakeParticle(), cl_particles, cl_particles_quake, cl_particles_quality, i, cvar_t::integer, lhrandom, NULL, PARTICLE_BILLBOARD, particlepalette, PBLEND_ALPHA, pt_alphastatic, tex_particle, and cvar_t::value.

Referenced by CL_ParseTempEntity(), and VM_CL_te_explosion2().

◆ CL_ParticleRain()

void CL_ParticleRain ( const vec3_t mins,
const vec3_t maxs,
const vec3_t dir,
int count,
int colorbase,
int type )

Definition at line 2088 of file cl_particles.c.

2089{
2090 int k;
2091 float minz, maxz, lifetime = 30;
2092 float particle_size;
2093 vec3_t org;
2094
2095 if (!cl_particles.integer) return;
2096 if (dir[2] < 0) // falling
2097 {
2098 minz = maxs[2] + dir[2] * 0.1;
2099 maxz = maxs[2];
2100 if (cl.worldmodel)
2101 lifetime = (maxz - cl.worldmodel->normalmins[2]) / max(1, -dir[2]);
2102 }
2103 else // rising??
2104 {
2105 minz = mins[2];
2106 maxz = maxs[2] + dir[2] * 0.1;
2107 if (cl.worldmodel)
2108 lifetime = (cl.worldmodel->normalmaxs[2] - minz) / max(1, dir[2]);
2109 }
2110
2112
2113 switch(type)
2114 {
2115 case 0:
2116 if (!cl_particles_rain.integer) break;
2117
2118 count *= 4; // ick, this should be in the mod or maps?
2119 particle_size = (gamemode == GAME_GOODVSBAD2) ? 20 : 0.5;
2120
2121 while(count--)
2122 {
2123 k = particlepalette[colorbase + (rand()&3)];
2124 VectorSet(org, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(minz, maxz));
2125 CL_NewParticle(org, pt_rain, k, k, tex_particle, particle_size, 0, lhrandom(32, 64), 0, 0, -1, org[0], org[1], org[2], dir[0], dir[1], dir[2], 0, 0, 0, 0, true, lifetime, 1, PBLEND_ADD, PARTICLE_SPARK, -1, -1, -1, 1, 1, 0, 0, NULL);
2126 }
2127 break;
2128 case 1:
2129 if (!cl_particles_snow.integer) break;
2130
2131 particle_size = (gamemode == GAME_GOODVSBAD2) ? 20 : 1.0;
2132
2133 while(count--)
2134 {
2135 k = particlepalette[colorbase + (rand()&3)];
2136 VectorSet(org, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(minz, maxz));
2137 CL_NewParticle(org, pt_snow, k, k, tex_particle, 1, 0, lhrandom(64, 128), 0, 0, -1, org[0], org[1], org[2], dir[0], dir[1], dir[2], 0, 0, 0, 0, true, lifetime, 1, PBLEND_ADD, PARTICLE_BILLBOARD, -1, -1, -1, 1, 1, 0, 0, NULL);
2138 }
2139 break;
2140 default:
2141 Con_Printf ("CL_ParticleRain: unknown type %i (0 = rain, 1 = snow)\n", type);
2142 }
2143}
cvar_t cl_particles_snow
cvar_t cl_particles_rain
gamemode_t gamemode
Definition com_game.c:26
@ GAME_GOODVSBAD2
Definition com_game.h:36
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
float particle_size
GLenum type
Definition glquake.h:656
#define max(A, B)
Definition mathlib.h:38
#define VectorSet(vec, x, y, z)
Definition mathlib.h:96
struct model_s * worldmodel
Definition client.h:934

References cl, CL_NewParticle(), cl_particles, cl_particles_quality, cl_particles_rain, cl_particles_snow, Con_Printf(), count, dir, GAME_GOODVSBAD2, gamemode, int(), cvar_t::integer, lhrandom, max, maxs, mins, NULL, PARTICLE_BILLBOARD, particle_size, PARTICLE_SPARK, particlepalette, PBLEND_ADD, pt_rain, pt_snow, tex_particle, type, cvar_t::value, VectorSet, and client_state_t::worldmodel.

Referenced by CL_ParseTempEntity(), VM_CL_te_particlerain(), and VM_CL_te_particlesnow().

◆ CL_Particles_Clear()

void CL_Particles_Clear ( void )

◆ CL_Particles_Init()

void CL_Particles_Init ( void )

Definition at line 586 of file cl_particles.c.

587{
588 Cmd_AddCommand(CF_CLIENT, "pointfile", CL_ReadPointFile_f, "display point file produced by qbsp when a leak was detected in the map (a line leading through the leak hole, to an entity inside the level)");
589 Cmd_AddCommand(CF_CLIENT, "cl_particles_reloadeffects", CL_Particles_LoadEffectInfo_f, "reloads effectinfo.txt and maps/levelname_effectinfo.txt (where levelname is the current map) if parameter is given, loads from custom file (no levelname_effectinfo are loaded in this case)");
590
624}
cvar_t cl_particles_visculling
void CL_ReadPointFile_f(cmd_state_t *cmd)
cvar_t cl_particles_blood_bloodhack
cvar_t cl_particles_blood_decal_alpha
cvar_t cl_decals
cvar_t cl_particles_blood_alpha
cvar_t cl_decals_newsystem_bloodsmears
cvar_t cl_particles_smoke_alpha
cvar_t cl_decals_newsystem_immediatebloodstain
cvar_t cl_particles_forcetraileffects
cvar_t cl_particles_blood
cvar_t cl_particles_smoke_alphafade
cvar_t cl_particles_alpha
cvar_t cl_particles_blood_decal_scalemax
cvar_t cl_particles_collisions
cvar_t cl_particles_blood_decal_scalemin
cvar_t cl_particles_size
cvar_t cl_decals_models
cvar_t cl_decals_bias
cvar_t cl_decals_fadetime
cvar_t cl_particles_bulletimpacts
cvar_t cl_decals_time
cvar_t cl_particles_smoke
static void CL_Particles_LoadEffectInfo_f(cmd_state_t *cmd)
cvar_t cl_decals_newsystem_intensitymultiplier
cvar_t cl_decals_max
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599

References CF_CLIENT, cl_decals, cl_decals_bias, cl_decals_fadetime, cl_decals_max, cl_decals_models, cl_decals_newsystem_bloodsmears, cl_decals_newsystem_immediatebloodstain, cl_decals_newsystem_intensitymultiplier, cl_decals_time, cl_particles, cl_particles_alpha, cl_particles_blood, cl_particles_blood_alpha, cl_particles_blood_bloodhack, cl_particles_blood_decal_alpha, cl_particles_blood_decal_scalemax, cl_particles_blood_decal_scalemin, cl_particles_bubbles, cl_particles_bulletimpacts, cl_particles_collisions, cl_particles_explosions_shell, cl_particles_explosions_sparks, cl_particles_forcetraileffects, CL_Particles_LoadEffectInfo_f(), cl_particles_quake, cl_particles_quality, cl_particles_rain, cl_particles_size, cl_particles_smoke, cl_particles_smoke_alpha, cl_particles_smoke_alphafade, cl_particles_snow, cl_particles_sparks, cl_particles_visculling, CL_ReadPointFile_f(), Cmd_AddCommand(), and Cvar_RegisterVariable().

Referenced by CL_Init().

◆ CL_Particles_Shutdown()

void CL_Particles_Shutdown ( void )

Definition at line 626 of file cl_particles.c.

627{
628}

Referenced by CL_Shutdown().

◆ CL_ParticleTrail()

void CL_ParticleTrail ( int effectindex,
float pcount,
const vec3_t originmins,
const vec3_t originmaxs,
const vec3_t velocitymins,
const vec3_t velocitymaxs,
struct entity_s * ent,
int palettecolor,
qbool spawndlight,
qbool spawnparticles,
float tintmins[4],
float tintmaxs[4],
float fade )

Variable Documentation

◆ cl_decals

struct cvar_s cl_decals
extern

Definition at line 303 of file cl_particles.c.

303{CF_CLIENT | CF_ARCHIVE, "cl_decals", "1", "enables decals (bullet holes, blood, etc)"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by CL_ImmediateBloodStain(), CL_Particles_Init(), CL_SpawnDecalParticleForSurface(), M_Menu_Options_Effects_AdjustSliders(), M_Options_Effects_Draw(), and R_DrawParticles().

◆ cl_decals_fadetime

struct cvar_s cl_decals_fadetime
extern

Definition at line 305 of file cl_particles.c.

305{CF_CLIENT | CF_ARCHIVE, "cl_decals_fadetime", "1", "how long decals take to fade away"};

Referenced by CL_Particles_Init(), R_DrawModelDecals_Entity(), and R_DrawModelDecals_FadeEntity().

◆ cl_decals_time

struct cvar_s cl_decals_time
extern

Definition at line 304 of file cl_particles.c.

304{CF_CLIENT | CF_ARCHIVE, "cl_decals_time", "20", "how long before decals start to fade away"};

Referenced by CL_Particles_Init(), R_DrawModelDecals_Entity(), and R_DrawModelDecals_FadeEntity().

◆ cl_particles

◆ cl_particles_blood

struct cvar_s cl_particles_blood
extern

Definition at line 284 of file cl_particles.c.

284{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood", "1", "enables blood effects"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleEffect_Fallback(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_blood_alpha

struct cvar_s cl_particles_blood_alpha
extern

Definition at line 285 of file cl_particles.c.

285{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood_alpha", "1", "opacity of blood, does not affect decals"};

Referenced by CL_ParticleEffect_Fallback(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_blood_bloodhack

struct cvar_s cl_particles_blood_bloodhack
extern

Definition at line 289 of file cl_particles.c.

289{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood_bloodhack", "1", "make certain quake particle() calls create blood effects instead"};

Referenced by CL_ParticleEffect_Fallback(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_blood_decal_alpha

struct cvar_s cl_particles_blood_decal_alpha
extern

Definition at line 286 of file cl_particles.c.

286{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood_decal_alpha", "1", "opacity of blood decal"};

Referenced by CL_Particles_Init(), and R_DrawParticles().

◆ cl_particles_blood_decal_scalemax

struct cvar_s cl_particles_blood_decal_scalemax
extern

Definition at line 288 of file cl_particles.c.

288{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood_decal_scalemax", "2", "maximal random scale of decal"};

Referenced by CL_Particles_Init(), and R_DrawParticles().

◆ cl_particles_blood_decal_scalemin

struct cvar_s cl_particles_blood_decal_scalemin
extern

Definition at line 287 of file cl_particles.c.

287{CF_CLIENT | CF_ARCHIVE, "cl_particles_blood_decal_scalemin", "1.5", "minimal random scale of decal"};

Referenced by CL_Particles_Init(), and R_DrawParticles().

◆ cl_particles_bubbles

struct cvar_s cl_particles_bubbles
extern

Definition at line 299 of file cl_particles.c.

299{CF_CLIENT | CF_ARCHIVE, "cl_particles_bubbles", "1", "enables bubbles (used by multiple effects)"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_bulletimpacts

struct cvar_s cl_particles_bulletimpacts
extern

Definition at line 290 of file cl_particles.c.

290{CF_CLIENT | CF_ARCHIVE, "cl_particles_bulletimpacts", "1", "enables bulletimpact effects"};

Referenced by CL_ParticleEffect_Fallback(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_explosions_shell

struct cvar_s cl_particles_explosions_shell
extern

Definition at line 292 of file cl_particles.c.

292{CF_CLIENT | CF_ARCHIVE, "cl_particles_explosions_shell", "0", "enables polygonal shell from explosions"};

Referenced by CL_ParticleExplosion(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_explosions_sparks

struct cvar_s cl_particles_explosions_sparks
extern

Definition at line 291 of file cl_particles.c.

291{CF_CLIENT | CF_ARCHIVE, "cl_particles_explosions_sparks", "1", "enables sparks from explosions"};

Referenced by CL_ParticleExplosion(), and CL_Particles_Init().

◆ cl_particles_quake

struct cvar_s cl_particles_quake
extern

Definition at line 283 of file cl_particles.c.

283{CF_CLIENT | CF_ARCHIVE, "cl_particles_quake", "0", "0: Fancy particles; 1: Disc particles like GLQuake; 2: Square particles like software-rendered Quake"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_NewQuakeParticle(), CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), CL_ParticleExplosion2(), CL_Particles_Init(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_quality

struct cvar_s cl_particles_quality
extern

◆ cl_particles_rain

struct cvar_s cl_particles_rain
extern

Definition at line 293 of file cl_particles.c.

293{CF_CLIENT | CF_ARCHIVE, "cl_particles_rain", "1", "enables rain effects"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleRain(), and CL_Particles_Init().

◆ cl_particles_size

struct cvar_s cl_particles_size
extern

Definition at line 282 of file cl_particles.c.

282{CF_CLIENT | CF_ARCHIVE, "cl_particles_size", "1", "multiplies particle size"};

Referenced by CL_Particles_Init(), and R_DrawParticle_TransparentCallback().

◆ cl_particles_smoke

struct cvar_s cl_particles_smoke
extern

Definition at line 295 of file cl_particles.c.

295{CF_CLIENT | CF_ARCHIVE, "cl_particles_smoke", "1", "enables smoke (used by multiple effects)"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleEffect_Fallback(), CL_Particles_Init(), CL_Smoke(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().

◆ cl_particles_smoke_alpha

struct cvar_s cl_particles_smoke_alpha
extern

Definition at line 296 of file cl_particles.c.

296{CF_CLIENT | CF_ARCHIVE, "cl_particles_smoke_alpha", "0.5", "smoke brightness"};

Referenced by CL_ParticleEffect_Fallback(), and CL_Particles_Init().

◆ cl_particles_smoke_alphafade

struct cvar_s cl_particles_smoke_alphafade
extern

Definition at line 297 of file cl_particles.c.

297{CF_CLIENT | CF_ARCHIVE, "cl_particles_smoke_alphafade", "0.55", "brightness fade per second"};

Referenced by CL_ParticleEffect_Fallback(), and CL_Particles_Init().

◆ cl_particles_snow

struct cvar_s cl_particles_snow
extern

Definition at line 294 of file cl_particles.c.

294{CF_CLIENT | CF_ARCHIVE, "cl_particles_snow", "1", "enables snow effects"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleRain(), and CL_Particles_Init().

◆ cl_particles_sparks

struct cvar_s cl_particles_sparks
extern

Definition at line 298 of file cl_particles.c.

298{CF_CLIENT | CF_ARCHIVE, "cl_particles_sparks", "1", "enables sparks (used by multiple effects)"};

Referenced by CL_NewParticlesFromEffectinfo(), CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), CL_Particles_Init(), CL_Sparks(), M_Menu_Options_Effects_AdjustSliders(), and M_Options_Effects_Draw().