Browse Source

Compile original particle code only when USE_OPENGL is defined. This means the old particle simulations are not being executed when in headless mode.

readme
Nico de Poel 5 years ago
parent
commit
ab8b2295df
  1. 30
      engine/Quake/r_part.c

30
engine/Quake/r_part.c

@ -44,6 +44,7 @@ float texturescalefactor; //johnfitz -- compensate for apparent size of differen
cvar_t r_particles = {"r_particles","1", CVAR_ARCHIVE}; //johnfitz cvar_t r_particles = {"r_particles","1", CVAR_ARCHIVE}; //johnfitz
cvar_t r_quadparticles = {"r_quadparticles","1", CVAR_ARCHIVE}; //johnfitz cvar_t r_quadparticles = {"r_quadparticles","1", CVAR_ARCHIVE}; //johnfitz
#ifdef USE_OPENGL
/* /*
=============== ===============
R_ParticleTextureLookup -- johnfitz -- generate nice antialiased 32x32 circle for particles R_ParticleTextureLookup -- johnfitz -- generate nice antialiased 32x32 circle for particles
@ -140,6 +141,7 @@ static void R_SetParticleTexture_f (cvar_t *var)
// break; // break;
} }
} }
#endif // USE_OPENGL
/* /*
=============== ===============
@ -148,6 +150,7 @@ R_InitParticles
*/ */
void R_InitParticles (void) void R_InitParticles (void)
{ {
#ifdef USE_OPENGL
int i; int i;
i = COM_CheckParm ("-particles"); i = COM_CheckParm ("-particles");
@ -171,6 +174,7 @@ void R_InitParticles (void)
Cvar_RegisterVariable (&r_quadparticles); //johnfitz Cvar_RegisterVariable (&r_quadparticles); //johnfitz
R_InitParticleTextures (); //johnfitz R_InitParticleTextures (); //johnfitz
#endif
} }
/* /*
@ -188,6 +192,7 @@ float timescale = 0.01;
void R_EntityParticles (entity_t *ent) void R_EntityParticles (entity_t *ent)
{ {
#ifdef USE_OPENGL
int i; int i;
particle_t *p; particle_t *p;
float angle; float angle;
@ -241,6 +246,7 @@ void R_EntityParticles (entity_t *ent)
p->org[1] = ent->origin[1] + r_avertexnormals[i][1]*dist + forward[1]*beamlength; p->org[1] = ent->origin[1] + r_avertexnormals[i][1]*dist + forward[1]*beamlength;
p->org[2] = ent->origin[2] + r_avertexnormals[i][2]*dist + forward[2]*beamlength; p->org[2] = ent->origin[2] + r_avertexnormals[i][2]*dist + forward[2]*beamlength;
} }
#endif
} }
/* /*
@ -250,6 +256,7 @@ R_ClearParticles
*/ */
void R_ClearParticles (void) void R_ClearParticles (void)
{ {
#ifdef USE_OPENGL
int i; int i;
free_particles = &particles[0]; free_particles = &particles[0];
@ -258,6 +265,7 @@ void R_ClearParticles (void)
for (i=0 ;i<r_numparticles ; i++) for (i=0 ;i<r_numparticles ; i++)
particles[i].next = &particles[i+1]; particles[i].next = &particles[i+1];
particles[r_numparticles-1].next = NULL; particles[r_numparticles-1].next = NULL;
#endif
} }
/* /*
@ -267,6 +275,7 @@ R_ReadPointFile_f
*/ */
void R_ReadPointFile_f (void) void R_ReadPointFile_f (void)
{ {
#ifdef USE_OPENGL
FILE *f; FILE *f;
vec3_t org; vec3_t org;
int r; int r;
@ -315,6 +324,7 @@ void R_ReadPointFile_f (void)
fclose (f); fclose (f);
Con_Printf ("%i points read\n", c); Con_Printf ("%i points read\n", c);
#endif
} }
/* /*
@ -351,6 +361,7 @@ R_ParticleExplosion
*/ */
void R_ParticleExplosion (vec3_t org) void R_ParticleExplosion (vec3_t org)
{ {
#ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -385,6 +396,7 @@ void R_ParticleExplosion (vec3_t org)
} }
} }
} }
#endif
UQ_Game_ParticleExplosion(org); UQ_Game_ParticleExplosion(org);
} }
@ -396,6 +408,7 @@ R_ParticleExplosion2
*/ */
void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength) void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
{ {
#ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
int colorMod = 0; int colorMod = 0;
@ -420,6 +433,7 @@ void R_ParticleExplosion2 (vec3_t org, int colorStart, int colorLength)
p->vel[j] = (rand()%512)-256; p->vel[j] = (rand()%512)-256;
} }
} }
#endif
} }
/* /*
@ -429,6 +443,7 @@ R_BlobExplosion
*/ */
void R_BlobExplosion (vec3_t org) void R_BlobExplosion (vec3_t org)
{ {
#ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -464,6 +479,7 @@ void R_BlobExplosion (vec3_t org)
} }
} }
} }
#endif
} }
/* /*
@ -473,6 +489,7 @@ R_RunParticleEffect
*/ */
void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
{ {
#ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -521,6 +538,7 @@ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
} }
} }
} }
#endif
if (count == 1024) if (count == 1024)
UQ_Game_ParticleExplosion(org); UQ_Game_ParticleExplosion(org);
@ -535,6 +553,7 @@ R_LavaSplash
*/ */
void R_LavaSplash (vec3_t org) void R_LavaSplash (vec3_t org)
{ {
#ifdef USE_OPENGL
int i, j, k; int i, j, k;
particle_t *p; particle_t *p;
float vel; float vel;
@ -567,6 +586,7 @@ void R_LavaSplash (vec3_t org)
vel = 50 + (rand()&63); vel = 50 + (rand()&63);
VectorScale (dir, vel, p->vel); VectorScale (dir, vel, p->vel);
} }
#endif
UQ_Game_LavaSplash(org); UQ_Game_LavaSplash(org);
} }
@ -578,6 +598,7 @@ R_TeleportSplash
*/ */
void R_TeleportSplash (vec3_t org) void R_TeleportSplash (vec3_t org)
{ {
#ifdef USE_OPENGL
int i, j, k; int i, j, k;
particle_t *p; particle_t *p;
float vel; float vel;
@ -610,6 +631,7 @@ void R_TeleportSplash (vec3_t org)
vel = 50 + (rand()&63); vel = 50 + (rand()&63);
VectorScale (dir, vel, p->vel); VectorScale (dir, vel, p->vel);
} }
#endif
UQ_Game_TeleportSplash(org); UQ_Game_TeleportSplash(org);
} }
@ -623,6 +645,7 @@ FIXME -- rename function and use #defined types instead of numbers
*/ */
void R_RocketTrail (vec3_t start, vec3_t end, int type) void R_RocketTrail (vec3_t start, vec3_t end, int type)
{ {
#ifdef USE_OPENGL
vec3_t vec; vec3_t vec;
float len; float len;
int j; int j;
@ -722,6 +745,7 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type)
VectorAdd (start, vec, start); VectorAdd (start, vec, start);
} }
#endif
} }
/* /*
@ -731,6 +755,7 @@ CL_RunParticles -- johnfitz -- all the particle behavior, separated from R_DrawP
*/ */
void CL_RunParticles (void) void CL_RunParticles (void)
{ {
#ifdef USE_OPENGL
particle_t *p, *kill; particle_t *p, *kill;
int i; int i;
float time1, time2, time3, dvel, frametime, grav; float time1, time2, time3, dvel, frametime, grav;
@ -828,6 +853,7 @@ void CL_RunParticles (void)
break; break;
} }
} }
#endif
} }
/* /*
@ -837,6 +863,7 @@ R_DrawParticles -- johnfitz -- moved all non-drawing code to CL_RunParticles
*/ */
void R_DrawParticles (void) void R_DrawParticles (void)
{ {
#ifdef USE_OPENGL
particle_t *p; particle_t *p;
float scale; float scale;
vec3_t up, right, p_up, p_right, p_upright; //johnfitz -- p_ vectors vec3_t up, right, p_up, p_right, p_upright; //johnfitz -- p_ vectors
@ -952,6 +979,7 @@ void R_DrawParticles (void)
glDisable (GL_BLEND); glDisable (GL_BLEND);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glColor3f(1,1,1); glColor3f(1,1,1);
#endif
} }
@ -962,6 +990,7 @@ R_DrawParticles_ShowTris -- johnfitz
*/ */
void R_DrawParticles_ShowTris (void) void R_DrawParticles_ShowTris (void)
{ {
#ifdef USE_OPENGL
particle_t *p; particle_t *p;
float scale; float scale;
vec3_t up, right, p_up, p_right, p_upright; vec3_t up, right, p_up, p_right, p_upright;
@ -1032,5 +1061,6 @@ void R_DrawParticles_ShowTris (void)
} }
glEnd (); glEnd ();
} }
#endif
} }
Loading…
Cancel
Save