Skip to content

Commit

Permalink
cgame: Optimize particles code and remove an useless extern variable …
Browse files Browse the repository at this point in the history
…in cg_local.h
  • Loading branch information
LegendaryGuard committed Mar 24, 2024
1 parent cf6aed9 commit 19c49e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 0 additions & 4 deletions source/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,3 @@ void CG_ParticleSnow (qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb
void CG_ParticleSnowFlurry (qhandle_t pshader, centity_t *cent);
int CG_NewParticleArea ( int num ); // BFP - Unused function for particles, looks like here is to determine in the areas
#endif

extern qboolean initparticles;


18 changes: 9 additions & 9 deletions source/cgame/cg_particles.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,18 @@ static int numShaderAnims;
#define PARTICLE_GRAVITY 40
#define MAX_PARTICLES 1024 * 8

cparticle_t *active_particles, *free_particles;
cparticle_t particles[MAX_PARTICLES];
int cl_numparticles = MAX_PARTICLES;
static cparticle_t *active_particles, *free_particles;
static cparticle_t particles[MAX_PARTICLES];
static int cl_numparticles = MAX_PARTICLES;

qboolean initparticles = qfalse;
vec3_t vforward, vright, vup;
vec3_t rforward, rright, rup;
static qboolean initparticles = qfalse;
static vec3_t vforward, vright, vup;
static vec3_t rforward, rright, rup;

float oldtime;
static float oldtime;

// BFP - NOTE: Particles use non-timescaled, before it was timescaled by game using cg.time
int timenonscaled;
static int timenonscaled;

#define NORMALSIZE 16
#define LARGESIZE 32
Expand Down Expand Up @@ -996,7 +996,7 @@ void CG_ParticleBubble (centity_t *cent, qhandle_t pshader, vec3_t origin, vec3_
VectorSet( p->accel,
crandom() * 10,
crandom() * 10,
800 );
900 );
}

VectorCopy(origin, p->org);
Expand Down

0 comments on commit 19c49e6

Please sign in to comment.