mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
cl_maxparticles to r_particles_max. annoying, but makes cl_ tab-completion less so.
This commit is contained in:
parent
9bf575d081
commit
29a8d84806
3 changed files with 16 additions and 22 deletions
|
@ -71,8 +71,8 @@ void R_InitParticles (void);
|
||||||
inline void R_ClearParticles (void);
|
inline void R_ClearParticles (void);
|
||||||
void R_DrawParticles (void);
|
void R_DrawParticles (void);
|
||||||
struct cvar_s;
|
struct cvar_s;
|
||||||
void R_MaxParticlesCheck (struct cvar_s *r_particles,
|
void R_MaxParticlesCheck (struct cvar_s *r_particles,
|
||||||
struct cvar_s *cl_max_particles);
|
struct cvar_s *r_particles_max);
|
||||||
|
|
||||||
extern unsigned int r_maxparticles;
|
extern unsigned int r_maxparticles;
|
||||||
extern unsigned int numparticles;
|
extern unsigned int numparticles;
|
||||||
|
|
|
@ -43,7 +43,6 @@ static const char rcsid[] =
|
||||||
|
|
||||||
cvar_t *cl_crossx;
|
cvar_t *cl_crossx;
|
||||||
cvar_t *cl_crossy;
|
cvar_t *cl_crossy;
|
||||||
cvar_t *cl_max_particles;
|
|
||||||
cvar_t *cl_verstring;
|
cvar_t *cl_verstring;
|
||||||
cvar_t *crosshair;
|
cvar_t *crosshair;
|
||||||
cvar_t *crosshaircolor;
|
cvar_t *crosshaircolor;
|
||||||
|
@ -61,7 +60,6 @@ cvar_t *gl_dlight_smooth;
|
||||||
cvar_t *gl_fb_bmodels;
|
cvar_t *gl_fb_bmodels;
|
||||||
cvar_t *gl_fb_models;
|
cvar_t *gl_fb_models;
|
||||||
cvar_t *gl_fires;
|
cvar_t *gl_fires;
|
||||||
cvar_t *gl_keeptjunctions;
|
|
||||||
cvar_t *gl_lerp_anim;
|
cvar_t *gl_lerp_anim;
|
||||||
cvar_t *gl_driver;
|
cvar_t *gl_driver;
|
||||||
cvar_t *gl_lightmap_align;
|
cvar_t *gl_lightmap_align;
|
||||||
|
@ -87,12 +85,12 @@ cvar_t *r_clearcolor;
|
||||||
cvar_t *r_dlight_lightmap;
|
cvar_t *r_dlight_lightmap;
|
||||||
cvar_t *r_dlight_max;
|
cvar_t *r_dlight_max;
|
||||||
cvar_t *r_drawentities;
|
cvar_t *r_drawentities;
|
||||||
cvar_t *r_drawexplosions; // DESPAIR
|
cvar_t *r_drawexplosions;
|
||||||
cvar_t *r_drawflat;
|
cvar_t *r_drawflat;
|
||||||
cvar_t *r_drawviewmodel;
|
cvar_t *r_drawviewmodel;
|
||||||
cvar_t *r_dspeeds;
|
cvar_t *r_dspeeds;
|
||||||
cvar_t *r_dynamic;
|
cvar_t *r_dynamic;
|
||||||
cvar_t *r_explosionclip; // DESPAIR
|
cvar_t *r_explosionclip;
|
||||||
cvar_t *r_firecolor;
|
cvar_t *r_firecolor;
|
||||||
cvar_t *r_graphheight;
|
cvar_t *r_graphheight;
|
||||||
cvar_t *r_lightmap_components;
|
cvar_t *r_lightmap_components;
|
||||||
|
@ -107,6 +105,7 @@ cvar_t *r_novis;
|
||||||
cvar_t *r_numedges;
|
cvar_t *r_numedges;
|
||||||
cvar_t *r_numsurfs;
|
cvar_t *r_numsurfs;
|
||||||
cvar_t *r_particles;
|
cvar_t *r_particles;
|
||||||
|
cvar_t *r_particles_max;
|
||||||
cvar_t *r_reportedgeout;
|
cvar_t *r_reportedgeout;
|
||||||
cvar_t *r_reportsurfout;
|
cvar_t *r_reportsurfout;
|
||||||
cvar_t *r_shadows;
|
cvar_t *r_shadows;
|
||||||
|
@ -129,16 +128,14 @@ cvar_t *scr_showturtle;
|
||||||
cvar_t *scr_viewsize;
|
cvar_t *scr_viewsize;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
r_particles_f (cvar_t *var)
|
r_particles_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
R_MaxParticlesCheck (var, cl_max_particles);
|
R_MaxParticlesCheck (var, r_particles_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cl_max_particles_f (cvar_t *var)
|
r_particles_max_f (cvar_t *var)
|
||||||
{
|
{
|
||||||
R_MaxParticlesCheck (r_particles, var);
|
R_MaxParticlesCheck (r_particles, var);
|
||||||
}
|
}
|
||||||
|
@ -151,10 +148,6 @@ R_Init_Cvars (void)
|
||||||
"Sets the position of the crosshair on the X-axis.");
|
"Sets the position of the crosshair on the X-axis.");
|
||||||
cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL,
|
cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL,
|
||||||
"Sets the position of the crosshair on the Y-axis.");
|
"Sets the position of the crosshair on the Y-axis.");
|
||||||
cl_max_particles = Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE,
|
|
||||||
cl_max_particles_f, "Maximum amount of "
|
|
||||||
"particles to display. No maximum, minimum "
|
|
||||||
"is 0.");
|
|
||||||
cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE,
|
cl_verstring = Cvar_Get ("cl_verstring", PROGRAM " " VERSION, CVAR_NONE,
|
||||||
NULL, "Client version string");
|
NULL, "Client version string");
|
||||||
crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair "
|
crosshair = Cvar_Get ("crosshair", "0", CVAR_ARCHIVE, NULL, "Crosshair "
|
||||||
|
@ -187,9 +180,6 @@ R_Init_Cvars (void)
|
||||||
"Toggles fullbright color support for models");
|
"Toggles fullbright color support for models");
|
||||||
gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL,
|
gl_fires = Cvar_Get ("gl_fires", "0", CVAR_ARCHIVE, NULL,
|
||||||
"Toggles lavaball and rocket fireballs");
|
"Toggles lavaball and rocket fireballs");
|
||||||
gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "1", CVAR_ARCHIVE, NULL,
|
|
||||||
"Set to 0 to turn off colinear vertexes "
|
|
||||||
"upon level load");
|
|
||||||
gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL,
|
gl_lerp_anim = Cvar_Get ("gl_lerp_anim", "1", CVAR_ARCHIVE, NULL,
|
||||||
"Toggles model animation interpolation");
|
"Toggles model animation interpolation");
|
||||||
|
|
||||||
|
@ -262,7 +252,7 @@ R_Init_Cvars (void)
|
||||||
"Toggles drawing of entities (almost "
|
"Toggles drawing of entities (almost "
|
||||||
"everything but the world)");
|
"everything but the world)");
|
||||||
r_drawexplosions = Cvar_Get ("r_drawexplosions", "1", CVAR_ARCHIVE, NULL,
|
r_drawexplosions = Cvar_Get ("r_drawexplosions", "1", CVAR_ARCHIVE, NULL,
|
||||||
"Draw explosions."); // DESPAIR
|
"Draw explosions.");
|
||||||
r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL,
|
r_drawflat = Cvar_Get ("r_drawflat", "0", CVAR_NONE, NULL,
|
||||||
"Toggles the drawing of textures");
|
"Toggles the drawing of textures");
|
||||||
r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL,
|
r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ARCHIVE, NULL,
|
||||||
|
@ -272,7 +262,7 @@ R_Init_Cvars (void)
|
||||||
r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL,
|
r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_NONE, NULL,
|
||||||
"Set to 0 to disable lightmap changes");
|
"Set to 0 to disable lightmap changes");
|
||||||
r_explosionclip = Cvar_Get ("r_explosionclip", "0", CVAR_ARCHIVE, NULL,
|
r_explosionclip = Cvar_Get ("r_explosionclip", "0", CVAR_ARCHIVE, NULL,
|
||||||
"Clip explosions."); // DESPAIR
|
"Clip explosions.");
|
||||||
r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, NULL,
|
r_firecolor = Cvar_Get ("r_firecolor", "0.9 0.4 0", CVAR_ARCHIVE, NULL,
|
||||||
"color of rocket and lava ball fires");
|
"color of rocket and lava ball fires");
|
||||||
r_graphheight = Cvar_Get ("r_graphheight", "32", CVAR_NONE, NULL,
|
r_graphheight = Cvar_Get ("r_graphheight", "32", CVAR_NONE, NULL,
|
||||||
|
@ -305,6 +295,10 @@ R_Init_Cvars (void)
|
||||||
"currently being viewed");
|
"currently being viewed");
|
||||||
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, r_particles_f,
|
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, r_particles_f,
|
||||||
"Toggles drawing of particles.");
|
"Toggles drawing of particles.");
|
||||||
|
r_particles_max = Cvar_Get ("r_particles_max", "2048", CVAR_ARCHIVE,
|
||||||
|
r_particles_max_f, "Maximum amount of "
|
||||||
|
"particles to display. No maximum, minimum "
|
||||||
|
"is 0.");
|
||||||
r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL,
|
r_reportedgeout = Cvar_Get ("r_reportedgeout", "0", CVAR_NONE, NULL,
|
||||||
"Toggle the display of how many edges were "
|
"Toggle the display of how many edges were "
|
||||||
"not displayed");
|
"not displayed");
|
||||||
|
|
|
@ -53,17 +53,17 @@ vec3_t r_pright, r_pup, r_ppn;
|
||||||
others.
|
others.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
R_MaxParticlesCheck (cvar_t *r_particles, cvar_t *cl_max_particles)
|
R_MaxParticlesCheck (cvar_t *r_particles, cvar_t *r_particles_max)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Catchall. If the user changed the setting to a number less than zero *or*
|
Catchall. If the user changed the setting to a number less than zero *or*
|
||||||
if we had a wacky cfg get past the init code check, this will make sure we
|
if we had a wacky cfg get past the init code check, this will make sure we
|
||||||
don't have problems. Also note that grabbing the var->int_val is IMPORTANT:
|
don't have problems. Also note that grabbing the var->int_val is IMPORTANT:
|
||||||
Prevents a segfault since if we grabbed the int_val of cl_max_particles
|
Prevents a segfault since if we grabbed the int_val of r_particles_max
|
||||||
we'd sig11 right here at startup.
|
we'd sig11 right here at startup.
|
||||||
*/
|
*/
|
||||||
if (r_particles && r_particles->int_val)
|
if (r_particles && r_particles->int_val)
|
||||||
r_maxparticles = cl_max_particles ? cl_max_particles->int_val : 0;
|
r_maxparticles = r_particles_max ? r_particles_max->int_val : 0;
|
||||||
else
|
else
|
||||||
r_maxparticles = 0;
|
r_maxparticles = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue