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

View file

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