From 86bc322c65e3e2eabb91edcfe897ef2183dbddf2 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 7 Jan 2017 16:28:46 -0800 Subject: sparkler: don't _particles_draw() empty children trivial per-particle savings --- modules/sparkler/particles.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/sparkler/particles.c') 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); + } } } -- cgit v1.2.1