]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
a simple optimization to particle allocation, increased bigass1.dem performance from...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 26 Apr 2006 13:12:43 +0000 (13:12 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 26 Apr 2006 13:12:43 +0000 (13:12 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6333 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index d7ba1661261a21cf722e0c014a6ba8ee42586d7b..92ee63f0b81e6f5a4f9418818907fea4adea5e54 100644 (file)
@@ -1428,7 +1428,11 @@ void CL_MoveParticles (void)
        for (i = 0, p = cl.particles;i < cl.num_particles;i++, p++)
        {
                if (!p->type)
+               {
+                       if (cl.free_particle > i)
+                               cl.free_particle = i;
                        continue;
+               }
                maxparticle = i;
                content = 0;
 
@@ -1437,6 +1441,8 @@ void CL_MoveParticles (void)
                if (p->alpha <= 0)
                {
                        p->type = NULL;
+                       if (cl.free_particle > i)
+                               cl.free_particle = i;
                        continue;
                }
 
@@ -1609,7 +1615,6 @@ void CL_MoveParticles (void)
                }
        }
        cl.num_particles = maxparticle + 1;
-       cl.free_particle = 0;
 }
 
 #define MAX_PARTICLETEXTURES 64