From 3601b5ba35ed8c23427008c9eaf6c0ace9b2fbd8 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 27 Oct 2001 21:39:58 +0000 Subject: [PATCH] fix the minor breakage were /no/ particles were being generated --- libs/video/renderer/r_cvar.c | 18 +++++++++--------- libs/video/renderer/r_part.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/video/renderer/r_cvar.c b/libs/video/renderer/r_cvar.c index 0776a3a45..691576b10 100644 --- a/libs/video/renderer/r_cvar.c +++ b/libs/video/renderer/r_cvar.c @@ -132,20 +132,20 @@ cvar_t *scr_viewsize; extern unsigned int r_maxparticles; extern cvar_t *gl_sky_divide; // FIXME -extern void R_MaxParticlesCheck (cvar_t *var); +extern void R_MaxParticlesCheck (cvar_t *r_particles, cvar_t *cl_max_particles); extern void R_MaxDlightsCheck (cvar_t *var); static void r_particles_f (cvar_t *var) { - if (!var->int_val) - R_ClearParticles (); - r_maxparticles = 0; - if (var->int_val && cl_max_particles) - r_maxparticles = cl_max_particles->int_val; - if (cl_max_particles) - R_MaxParticlesCheck (cl_max_particles); + R_MaxParticlesCheck (var, cl_max_particles); +} + +static void +cl_max_particles_f (cvar_t *var) +{ + R_MaxParticlesCheck (r_particles, var); } void @@ -156,7 +156,7 @@ R_Init_Cvars (void) cl_crossy = Cvar_Get ("cl_crossy", "0", CVAR_ARCHIVE, NULL, "Sets the position of the crosshair on the Y-axis."); cl_max_particles = Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, - R_MaxParticlesCheck, "Maximum amount of " + 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, diff --git a/libs/video/renderer/r_part.c b/libs/video/renderer/r_part.c index cc728b25e..a6772e486 100644 --- a/libs/video/renderer/r_part.c +++ b/libs/video/renderer/r_part.c @@ -56,7 +56,7 @@ extern cvar_t *r_particles; others. */ void -R_MaxParticlesCheck (cvar_t *var) +R_MaxParticlesCheck (cvar_t *r_particles, cvar_t *cl_max_particles) { /* Catchall. If the user changed the setting to a number less than zero *or* @@ -66,7 +66,7 @@ R_MaxParticlesCheck (cvar_t *var) we'd sig11 right here at startup. */ if (r_particles && r_particles->int_val) - r_maxparticles = var->int_val; + r_maxparticles = cl_max_particles ? cl_max_particles->int_val : 0; else r_maxparticles = 0;