Jeffrey "botman" Broome wrote:

...this probably should be...

float flPercent = 0.0f;

if (abs(maxZ - minZ) > 0.00001)  // avoid nasty divide by zero problem
   flPercent = (zCoords[iCurParticle] - minZ) / (maxZ - minZ);

...and while we're at it, quick optimization (you don't need to sort if
there's only one particle).  Change this...

// Do an O(N) bucket sort. This helps the sort when there are lots of
particles.
#define NUM_BUCKETS     32

..to this...

if (!pMaterial->m_Particles.m_pNext)  // is there only one particle?
   return;  // don't need to sort just one

// Do an O(N) bucket sort. This helps the sort when there are lots of
particles.
#define NUM_BUCKETS     32

--
Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to