diff options
Diffstat (limited to 'src/modules/sparkler/xplode.c')
-rw-r--r-- | src/modules/sparkler/xplode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/modules/sparkler/xplode.c b/src/modules/sparkler/xplode.c index 5f99f7b..3e3beb4 100644 --- a/src/modules/sparkler/xplode.c +++ b/src/modules/sparkler/xplode.c @@ -1,7 +1,7 @@ #include <stdlib.h> -#include "draw.h" #include "fb.h" +#include "helpers.h" #include "particle.h" #include "particles.h" @@ -61,11 +61,8 @@ static void xplode_draw(particles_t *particles, particle_t *p, int x, int y, fb_ xplode_ctxt_t *ctxt = p->ctxt; uint32_t color; - if (!fb_fragment_contains(f, x, y)) { - /* offscreen */ - ctxt->longevity = 0; + if (!should_draw_expire_if_oob(particles, p, x, y, f, &ctxt->longevity)) return; - } if (ctxt->longevity == ctxt->lifetime) { color = makergb(0xff, 0xff, 0xa0, 1.0); @@ -73,7 +70,7 @@ static void xplode_draw(particles_t *particles, particle_t *p, int x, int y, fb_ color = makergb(0xff, 0xff, 0x00, ((float)ctxt->longevity / ctxt->lifetime)); } - draw_pixel(f, x, y, color); + fb_fragment_put_pixel_unchecked(f, x, y, color); } |