From: lordhavoc Date: Tue, 24 Oct 2000 10:26:19 +0000 (+0000) Subject: fix for blob particle crash X-Git-Tag: RELEASE_0_2_0_RC1~958 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=70070a451001714625215cf750976b976a8a9c77;p=xonotic%2Fdarkplaces.git fix for blob particle crash git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@62 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_part.c b/r_part.c index 995b1529..e648e3a0 100644 --- a/r_part.c +++ b/r_part.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" -#define MAX_PARTICLES 32768 // default max # of particles at one time +#define MAX_PARTICLES 4096 // default max # of particles at one time #define ABSOLUTE_MIN_PARTICLES 512 // no fewer than this no matter what's on the command line // LordHavoc: added dust, smoke, snow, bloodcloud, and many others @@ -1214,7 +1214,7 @@ void R_DrawParticles (void) float grav, grav1, time1, time2, time3, dvel, frametime, scale, scale2, minparticledist; byte *color24; vec3_t up, right, uprightangles, forward2, up2, right2, tempcolor; - int activeparticles, maxparticle, j; + int activeparticles, maxparticle, j, k; // LordHavoc: early out condition if (!numparticles) @@ -1240,14 +1240,14 @@ void R_DrawParticles (void) activeparticles = 0; maxparticle = -1; j = 0; - for (i = 0, p = particles;i < numparticles;i++, p++) + for (k = 0, p = particles;k < numparticles;k++, p++) { if (p->die < cl.time) { freeparticles[j++] = p; continue; } - maxparticle = i; + maxparticle = k; activeparticles++; // LordHavoc: only render if not too close