diff --git a/qw/source/gl_dyn_part.c b/qw/source/gl_dyn_part.c index baabbd5d9..e2435a8b6 100644 --- a/qw/source/gl_dyn_part.c +++ b/qw/source/gl_dyn_part.c @@ -131,9 +131,6 @@ particle_new_random (ptype_t type, int texnum, vec3_t org, int org_fuzz, void R_MaxParticlesCheck (cvar_t *var) { - // Clear the particles ala sw so we're at least consistent somewhat. GL doesn't need to do it before the max however. - R_ClearParticles(); - /* 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 don't have problems. Also note that grabbing the var->int_val is IMPORTANT: @@ -156,6 +153,8 @@ R_MaxParticlesCheck (cvar_t *var) calloc (r_numparticles, sizeof (particle_t)); freeparticles = (particle_t **) calloc (r_numparticles, sizeof (particle_t*)); + + R_ClearParticles(); } /* @@ -168,7 +167,7 @@ R_Particles_Init_Cvars (void) // Misty-chan: This is a cvar that does callbacks. Whenever it changes, it calls the function // R_MaxParticlesCheck and therefore is very nifty. Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, R_MaxParticlesCheck, - "Maximum amount of particles to display"); + "Maximum amount of particles to display. No maximum, minimum is 0, although it's best to use r_particles 0 instead."); } /* diff --git a/qw/source/r_part.c b/qw/source/r_part.c index 9c9671cf3..c0c5fcf7e 100644 --- a/qw/source/r_part.c +++ b/qw/source/r_part.c @@ -54,6 +54,7 @@ cvar_t *r_particles; /* R_MaxParticlesCheck +Misty-chan: EXTREME heavy lifting and bugfixing thanks goes out to taniwha - I built this, and he got it working :) */ void R_MaxParticlesCheck (cvar_t *var) @@ -61,9 +62,11 @@ R_MaxParticlesCheck (cvar_t *var) // Do not use 0 in this! sw doesn't grok 0 and it's going to segfault if we do! r_numparticles = max(var->int_val, 1); - // Debugging code. will print what the above was set to, and is also useful - // for checking if this is accidentally being run all the time. Safe to remove if you fixed this section (!) + /* + Debugging code. will print what the above was set to, and is also useful + for checking if this is accidentally being run all the time. Con_Printf ("%d", r_numparticles); + */ if (particles) free (particles); @@ -77,16 +80,12 @@ R_MaxParticlesCheck (cvar_t *var) R_Particles_Init_Cvars */ -// Misty-chan: Hackhackhack to get below code to run. Remove if you got R_MaxParticlesCheck working! -cvar_t *cl_max_particles; - void R_Particles_Init_Cvars (void) { -// Does a callback... Currently which does absolutely NOTHING! Joy. -cl_max_particles = Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, R_MaxParticlesCheck, - "Maximum amount of particles to display"); -// This is a temporary hack until R_MaxParticlesCheck is fixed and does NOT belong here. Disable if you're trying to fix above code :) + // Does a callback to R_MaxParticleCheck when the cvar changes. Neat trick. + Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, R_MaxParticlesCheck, + "Maximum amount of particles to display. No maximum, minimum is 1."); } /*