void RetireActiveParticles()
{
float particleDuration = (float)settings.Duration.TotalSeconds;
while (firstActiveParticle != firstNewParticle)
{
// Is this particle old enough to retire?
float particleAge = currentTime - particles[firstActiveParticle].Time;
if (particleAge < particleDuration)
break;
// Remember the time at which we retired this particle.
particles[firstActiveParticle].Time = drawCounter;
// Move the particle from the active to the retired queue.
firstActiveParticle++;
if (firstActiveParticle >= particles.Length)
firstActiveParticle = 0;
}
}