From 820715672b04353b91d6aa62db3de579117b6abf Mon Sep 17 00:00:00 2001 From: "Timothy C. McGrath" Date: Tue, 20 Mar 2001 00:27:22 +0000 Subject: [PATCH] *DOH!* 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 --- qw/source/gl_dyn_part.c | 23 ++++++++++------------- qw/source/r_part.c | 7 ++++++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/qw/source/gl_dyn_part.c b/qw/source/gl_dyn_part.c index fcfd80b1f..5487e22c4 100644 --- a/qw/source/gl_dyn_part.c +++ b/qw/source/gl_dyn_part.c @@ -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); diff --git a/qw/source/r_part.c b/qw/source/r_part.c index 8c12837ba..c399918bd 100644 --- a/qw/source/r_part.c +++ b/qw/source/r_part.c @@ -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);