summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-01-07 16:28:46 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-01-07 16:28:46 -0800
commit86bc322c65e3e2eabb91edcfe897ef2183dbddf2 (patch)
treea3603533ab2c992f4c4d165392bd27abc6adb133
parent5bc0f3f05a856c839470942f9a8a1d3dbdc2ffce (diff)
sparkler: don't _particles_draw() empty children
trivial per-particle savings
-rw-r--r--modules/sparkler/particles.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/sparkler/particles.c b/modules/sparkler/particles.c
index daf60ef..cce8d7f 100644
--- a/modules/sparkler/particles.c
+++ b/modules/sparkler/particles.c
@@ -231,7 +231,10 @@ static inline void _particles_draw(particles_t *particles, list_head_t *list, fb
y = ((float)(p->props.position.y / (p->props.position.z - ZCONST)) * h2) + h2;
particle_draw(particles, &p->public, x, y, fragment);
- _particles_draw(particles, &p->children, fragment);
+
+ if (!list_empty(&p->children)) {
+ _particles_draw(particles, &p->children, fragment);
+ }
}
}
© All Rights Reserved