Rename gl_particles to r_particles, and allow software to disable particles as well. Thanks sergio!

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-01-29 00:13:01 +00:00
parent 2b165575dd
commit e930c800f0
6 changed files with 50 additions and 30 deletions

View file

@ -146,6 +146,7 @@ extern cvar_t *r_norefresh;
extern cvar_t *r_drawentities;
extern cvar_t *r_drawworld;
extern cvar_t *r_drawviewmodel;
extern cvar_t *r_particles;
extern cvar_t *r_speeds;
extern cvar_t *r_waterwarp;
extern cvar_t *r_shadows;
@ -164,7 +165,6 @@ extern cvar_t *gl_flashblend;
extern cvar_t *gl_keeptjunctions;
extern cvar_t *gl_multitexture;
extern cvar_t *gl_nocolors;
extern cvar_t *gl_particles;
extern cvar_t *gl_poly;
extern cvar_t *gl_polyblend;
extern cvar_t *gl_smooth;

View file

@ -1,7 +1,7 @@
/*
gl_dyn_part.c
Particle system!
OpenGL particle system.
Copyright (C) 1996-1997 Id Software, Inc.
@ -223,7 +223,7 @@ R_ParticleExplosion
void
R_ParticleExplosion (vec3_t org)
{
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
particle_new_random (pt_smokecloud, part_tex_smoke[rand () & 7], org, 4, 30,
@ -242,7 +242,7 @@ R_BlobExplosion (vec3_t org)
{
int i;
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
for (i = 0; i < 512; i++) {
@ -260,7 +260,7 @@ R_BlobExplosion (vec3_t org)
static void
R_RunSparkEffect (vec3_t org, int count, int ofuzz)
{
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
particle_new (pt_smokecloud, part_tex_smoke[rand () & 7], org,
@ -277,7 +277,7 @@ R_RunGunshotEffect (vec3_t org, int count)
{
int scale;
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
if (count > 6)
@ -292,7 +292,7 @@ R_RunGunshotEffect (vec3_t org, int count)
static void
R_BloodPuff (vec3_t org, int count)
{
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
particle_new (pt_bloodcloud, part_tex_smoke[rand () & 7], org, 9,
@ -308,7 +308,7 @@ R_RunPuffEffect
void
R_RunPuffEffect (vec3_t org, byte type, byte count)
{
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
switch (type) {
@ -336,7 +336,7 @@ R_RunParticleEffect (vec3_t org, int color, int count)
int i, j, scale;
vec3_t porg;
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
if (count > 130)
@ -388,7 +388,7 @@ R_LavaSplash (vec3_t org)
float vel;
vec3_t dir, porg, pvel;
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
for (i = -16; i < 16; i++) {
@ -424,7 +424,7 @@ R_TeleportSplash (vec3_t org)
float vel;
vec3_t dir, porg, pvel;
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
for (i = -16; i < 16; i += 4)
@ -461,7 +461,7 @@ R_RocketTrail (int type, entity_t *ent)
if (type == 0)
R_AddFire (ent->old_origin, ent->origin, ent);
if (!gl_particles->int_val)
if (!r_particles->int_val)
return;
VectorSubtract (ent->origin, ent->old_origin, vec);
@ -595,7 +595,7 @@ R_DrawParticles (void)
// Don't render particles too close to us.
// Note, we must still do physics and such on them.
if (!(DotProduct (part->org, vpn) < minparticledist) &&
gl_particles->int_val) {
r_particles->int_val) {
at = (byte *) & d_8to24table[(byte) part->color];
alpha = part->alpha;

View file

@ -100,31 +100,31 @@ float modelalpha; // Ender (EXtend) Alpha
void R_MarkLeaves (void);
cvar_t *r_norefresh;
cvar_t *r_drawentities;
cvar_t *r_drawviewmodel;
cvar_t *r_dynamic;
cvar_t *r_netgraph;
cvar_t *r_norefresh;
cvar_t *r_novis;
cvar_t *r_particles;
cvar_t *r_speeds;
cvar_t *r_shadows;
cvar_t *r_wateralpha;
cvar_t *r_waterripple;
cvar_t *r_dynamic;
cvar_t *r_novis;
cvar_t *r_netgraph;
cvar_t *gl_affinemodels;
cvar_t *gl_clear;
cvar_t *gl_cull;
cvar_t *gl_smooth;
cvar_t *gl_smoothdlights;
cvar_t *gl_affinemodels;
cvar_t *gl_flashblend;
cvar_t *gl_playermip;
cvar_t *gl_nocolors;
cvar_t *gl_keeptjunctions;
cvar_t *gl_particles;
cvar_t *gl_lerp_anim;
cvar_t *gl_fb_models;
cvar_t *gl_fb_bmodels;
cvar_t *gl_keeptjunctions;
cvar_t *gl_lerp_anim;
cvar_t *gl_multitexture;
cvar_t *gl_nocolors;
cvar_t *gl_playermip;
cvar_t *gl_smooth;
cvar_t *gl_smoothdlights;
cvar_t *r_skyname;
cvar_t *gl_skymultipass;

View file

@ -219,11 +219,10 @@ R_Init_Cvars (void)
r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, "Set to 0 to disable lightmap changes");
r_novis = Cvar_Get ("r_novis", "0", CVAR_NONE, "Set to 1 to enable runtime visibility checking (SLOW)");
r_speeds = Cvar_Get ("r_speeds", "0", CVAR_NONE, "Display drawing time and statistics of what is being viewed");
r_netgraph = Cvar_Get ("r_netgraph", "0", CVAR_ARCHIVE, "Graph network stats");
r_netgraph_alpha = Cvar_Get ("r_netgraph_alpha", "0.5", CVAR_ARCHIVE, "Net graph translucency");
r_netgraph_box = Cvar_Get ("r_netgraph_box", "1", CVAR_ARCHIVE, "Draw box around net graph");
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, "whether or not to draw particles");
r_skyname = Cvar_Get ("r_skyname", "none", CVAR_NONE, "name of the current skybox");
gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ARCHIVE, "Makes texture rendering quality better if set to 1");
@ -237,7 +236,6 @@ R_Init_Cvars (void)
gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, "Toggles model animation interpolation");
gl_multitexture = Cvar_Get ("gl_multitexture", "0", CVAR_ARCHIVE, "Use multitexture when available");
gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_NONE, "Set to 1, turns off all player colors");
gl_particles = Cvar_Get ("gl_particles", "1", CVAR_ARCHIVE, "whether or not to draw particles");
gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_NONE, "Detail of player skins. 0 best, 4 worst.");
gl_sky_clip = Cvar_Get ("gl_sky_clip", "0", CVAR_ARCHIVE, "controls whether sky is drawn first (0) or later (1)");
gl_sky_divide = Cvar_Get ("gl_sky_divide", "1", CVAR_ARCHIVE, "subdivide sky polys");

View file

@ -158,6 +158,7 @@ cvar_t *r_clearcolor;
cvar_t *r_waterwarp;
cvar_t *r_drawentities;
cvar_t *r_drawviewmodel;
cvar_t *r_particles;
cvar_t *r_aliasstats;
cvar_t *r_dspeeds;
cvar_t *r_drawflat;
@ -282,6 +283,7 @@ R_Init_Cvars (void)
r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_NONE, "Toggles whether surfaces are warped in a liquid.");
r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_NONE, "Toggles the drawing of entities.");
r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, "Toggles the drawing of your weapon");
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, "Toggles drawing of particles.");
r_aliasstats = Cvar_Get ("r_polymodelstats", "0", CVAR_NONE, "Toggles the displays of number of polygon models current being viewed");
r_dspeeds = Cvar_Get ("r_dspeeds", "0", CVAR_NONE, "Toggles the display of drawing speed information");
r_reportsurfout = Cvar_Get ("r_reportsurfout", "0", CVAR_NONE, "Toggle the display of how many surfaces where not displayed");

View file

@ -55,7 +55,7 @@ particle_t *particles;
int r_numparticles;
vec3_t r_pright, r_pup, r_ppn;
cvar_t *r_particles;
/*
===============
@ -172,6 +172,9 @@ R_RunSpikeEffect (vec3_t pos, byte type)
void
R_RunPuffEffect (vec3_t pos, byte type, byte cnt)
{
if (!r_particles->int_val)
return;
switch (type) {
case TE_GUNSHOT:
R_RunParticleEffect (pos, 0, 20 * cnt);
@ -197,6 +200,9 @@ R_ParticleExplosion (vec3_t org)
int i, j;
particle_t *p;
if (!r_particles->int_val)
return;
for (i = 0; i < 1024; i++) {
if (!free_particles)
return;
@ -236,6 +242,9 @@ R_BlobExplosion (vec3_t org)
int i, j;
particle_t *p;
if (!r_particles->int_val)
return;
for (i = 0; i < 1024; i++) {
if (!free_particles)
return;
@ -277,6 +286,9 @@ R_RunParticleEffect (vec3_t org, int color, int count)
particle_t *p;
int scale;
if (!r_particles->int_val)
return;
if (count > 130)
scale = 3;
else if (count > 20)
@ -317,6 +329,9 @@ R_LavaSplash (vec3_t org)
float vel;
vec3_t dir;
if (!r_particles->int_val)
return;
for (i = -16; i < 16; i++)
for (j = -16; j < 16; j++)
for (k = 0; k < 1; k++) {
@ -359,6 +374,9 @@ R_TeleportSplash (vec3_t org)
float vel;
vec3_t dir;
if (!r_particles->int_val)
return;
for (i = -16; i < 16; i += 4)
for (j = -16; j < 16; j += 4)
for (k = -24; k < 32; k += 4) {
@ -395,6 +413,9 @@ R_RocketTrail (int type, entity_t *ent)
int j;
particle_t *p;
if (!r_particles->int_val)
return;
VectorSubtract (ent->origin, ent->old_origin, vec);
len = VectorNormalize (vec);
while (len > 0) {
@ -462,7 +483,6 @@ R_RocketTrail (int type, entity_t *ent)
}
VectorAdd (ent->old_origin, vec, ent->old_origin);
}
}