summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-12-24 19:55:30 -0600
committerErkin Bahceci <erkinbah@gmail.com>2009-12-24 19:55:30 -0600
commit7e11b425be3aaf2bfce882fb0f36d2771e95a421 (patch)
treeac539a60a18abdb96bde1183cf9542e8730695ce
parent27e4c9aeb7b7f2d7055ed1dae1497d30e963edeb (diff)
downloadplugins-extra-7e11b425be3aaf2bfce882fb0f36d2771e95a421.tar.gz
plugins-extra-7e11b425be3aaf2bfce882fb0f36d2771e95a421.tar.bz2
Limit max number of new particles created simultaneously.
-rw-r--r--src/animationaddon/beamup.c4
-rw-r--r--src/animationaddon/burn.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/animationaddon/beamup.c b/src/animationaddon/beamup.c
index edf8659..ceab9fe 100644
--- a/src/animationaddon/beamup.c
+++ b/src/animationaddon/beamup.c
@@ -112,6 +112,10 @@ fxBeamUpGenNewBeam(CompWindow * w,
float partw = 2.5 * animGetF (w, ANIMADDON_SCREEN_OPTION_BEAMUP_SIZE);
+ // Limit max number of new particles created simultaneously
+ if (max_new > ps->numParticles)
+ max_new = ps->numParticles;
+
Particle *part = ps->particles;
int i;
for (i = 0; i < ps->numParticles && max_new > 0; i++, part++)
diff --git a/src/animationaddon/burn.c b/src/animationaddon/burn.c
index 16c6425..48aa97a 100644
--- a/src/animationaddon/burn.c
+++ b/src/animationaddon/burn.c
@@ -134,6 +134,10 @@ fxBurnGenNewFire(CompWindow * w,
float partw = animGetF (w, ANIMADDON_SCREEN_OPTION_FIRE_SIZE);
float parth = partw * 1.5;
+ // Limit max number of new particles created simultaneously
+ if (max_new > ps->numParticles / 5)
+ max_new = ps->numParticles / 5;
+
Particle *part = ps->particles;
int i;
for (i = 0; i < ps->numParticles && max_new > 0; i++, part++)
@@ -226,6 +230,10 @@ fxBurnGenNewSmoke(CompWindow * w,
float partSize = animGetF (w, ANIMADDON_SCREEN_OPTION_FIRE_SIZE) * size * 5;
float sizeNeg = -size;
+ // Limit max number of new particles created simultaneously
+ if (max_new > ps->numParticles)
+ max_new = ps->numParticles;
+
Particle *part = ps->particles;
int i;
for (i = 0; i < ps->numParticles && max_new > 0; i++, part++)