mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
Minor housecleaning. sw no longer spits out diagnostic output, comments
are now sane and match current code, I moved things around in GL so they more closely match the sw code, as the sw code makes more sense now that I *finally* understand what in gods name I was doing wrong. ;) I also made minor changes to the help to indicate the minimum values of the variables (sw can deal with 1, gl 0) as well as that you really ought to use r_particles 0 instead of a setting of cl_max_particles 0 in GL :P Thanks for all the help taniwha, those last two bugs were kicking my butt. Misty-chan
This commit is contained in:
parent
afaf10a2c8
commit
1843bb5839
2 changed files with 11 additions and 13 deletions
|
@ -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.");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue