Skip to content

Commit

Permalink
fixing a problem with infinite emiters
Browse files Browse the repository at this point in the history
  • Loading branch information
plattysoft committed May 24, 2014
1 parent 919dca3 commit 6f53c6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Binary file modified LeonidasExamples/bin/classes.dex
Binary file not shown.
Binary file modified LeonidasExamples/bin/resources.ap_
Binary file not shown.
4 changes: 3 additions & 1 deletion LeonidasLib/src/com/plattysoft/leonids/ParticleSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ private void activateParticle(int delay) {
}

private void onUpdate(int miliseconds) {
while (mEmitingTime > 0 && miliseconds < mEmitingTime && !mParticles.isEmpty() && mActivatedParticles < mParticlesPerMilisecond*miliseconds) {
while (((mEmitingTime > 0 && miliseconds < mEmitingTime)|| mEmitingTime == -1) && // This point should emit
!mParticles.isEmpty() && // We have particles in the pool
mActivatedParticles < mParticlesPerMilisecond*miliseconds) { // and we are under the number of particles that should be launched
// Activate a new particle
activateParticle(miliseconds);
}
Expand Down

0 comments on commit 6f53c6f

Please sign in to comment.