Skip to content
Browse files

issue 1201

prevent bursts of particles due to too high emitCounter.
Conflicts:

	cocos2d/CCParticleSystem.m
  • Loading branch information...
1 parent 5198d4d commit ec041135774a88ff350ed60e5be9061caaea15cd @ricardoquesada ricardoquesada committed Feb 17, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 cocos2d/CCParticleSystem.m
View
7 cocos2d/CCParticleSystem.m
@@ -459,13 +459,18 @@ -(void) update: (ccTime) dt
if( active && emissionRate ) {
float rate = 1.0f / emissionRate;
- emitCounter += dt;
+
+ //issue #1201, prevent bursts of particles, due to too high emitCounter
+ if (particleCount < totalParticles)
+ emitCounter += dt;
+
while( particleCount < totalParticles && emitCounter > rate ) {
[self addParticle];
emitCounter -= rate;
}
elapsed += dt;
+
if(duration != -1 && duration < elapsed)
[self stopSystem];
}

0 comments on commit ec04113

Please sign in to comment.
Something went wrong with that request. Please try again.