I goofed up my code. cl_max_particles will not dynamically update with
this change, but ATM, this is safer until I can grok what I need to know
to fix the code I wrote.

Sorry guys,
Misty-chan
This commit is contained in:
Timothy C. McGrath 2001-03-20 00:27:22 +00:00
parent 582a7902c5
commit 820715672b
2 changed files with 16 additions and 14 deletions

View file

@ -127,13 +127,8 @@ particle_new_random (ptype_t type, int texnum, vec3_t org, int org_fuzz,
void void
R_InitParticles (void) R_InitParticles (void)
{ {
if (cl_max_particles->int_val < 1) // Chooses cvar if bigger than zero, otherwise ignore and set variable to zero
{ r_numparticles = max(cl_max_particles->int_val, 0);
/* Protect against stupidity */
r_numparticles = 2048;
} else {
r_numparticles = cl_max_particles->int_val;
}
particles = (particle_t *) particles = (particle_t *)
Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles"); Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles");
@ -141,19 +136,20 @@ R_InitParticles (void)
freeparticles = (void *) freeparticles = (void *)
Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles"); Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles");
GDT_Init (); GDT_Init ();
} }
/* /*
R_MaxParticlesCheck R_MaxParticlesCheck
*/ */
/*
This entire section is disabled because I don't understand Hunk_Allocname, or how to fix it yet.
void void
R_MaxParticlesCheck (void) R_MaxParticlesCheck (void)
{ {
if (cl_max_particles->int_val == r_numparticles || cl_max_particles->int_val < 1) if (cl_max_particles->int_val == r_numparticles || cl_max_particles->int_val < 0)
{ {
return; return;
} else { } else {
R_ClearParticles(); R_ClearParticles();
r_numparticles = cl_max_particles->int_val; r_numparticles = cl_max_particles->int_val;
@ -166,7 +162,7 @@ R_MaxParticlesCheck (void)
Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles"); Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles");
} }
} }
*/
/* /*
R_ClearParticles R_ClearParticles
*/ */
@ -556,9 +552,10 @@ R_DrawParticles (void)
float scale; float scale;
particle_t *part; particle_t *part;
int activeparticles, maxparticle, j, k; int activeparticles, maxparticle, j, k;
/*
Disabled until I fix this
R_MaxParticlesCheck (); R_MaxParticlesCheck ();
*/
// LordHavoc: particles should not affect zbuffer // LordHavoc: particles should not affect zbuffer
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);

View file

@ -74,6 +74,8 @@ R_InitParticles (void)
/* /*
R_MaxParticlesCheck R_MaxParticlesCheck
*/ */
/*
Disabled until it is fixed
void void
R_MaxParticlesCheck (void) R_MaxParticlesCheck (void)
{ {
@ -88,6 +90,7 @@ R_MaxParticlesCheck (void)
Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles"); Hunk_AllocName (r_numparticles * sizeof (particle_t), "particles");
} }
} }
*/
/* /*
R_ClearParticles R_ClearParticles
@ -492,8 +495,10 @@ R_DrawParticles (void)
float dvel; float dvel;
float frametime; float frametime;
/*
Disabled until it is fixed.
R_MaxParticlesCheck (); R_MaxParticlesCheck ();
*/
D_StartParticles (); D_StartParticles ();
VectorScale (vright, xscaleshrink, r_pright); VectorScale (vright, xscaleshrink, r_pright);