summaryrefslogtreecommitdiff
path: root/src/modules/sparkler/spark.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/sparkler/spark.c')
-rw-r--r--src/modules/sparkler/spark.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/modules/sparkler/spark.c b/src/modules/sparkler/spark.c
index 786be78..aa449c6 100644
--- a/src/modules/sparkler/spark.c
+++ b/src/modules/sparkler/spark.c
@@ -1,7 +1,7 @@
#include <stdlib.h>
-#include "draw.h"
#include "fb.h"
+#include "helpers.h"
#include "particle.h"
#include "particles.h"
@@ -48,15 +48,11 @@ static void spark_draw(particles_t *particles, particle_t *p, int x, int y, fb_f
{
spark_ctxt_t *ctxt = p->ctxt;
- if (!fb_fragment_contains(f, x, y)) {
+ if (!should_draw_expire_if_oob(particles, p, x, y, f, &ctxt->longevity))
/* offscreen */
- ctxt->longevity = 0;
-
return;
- }
-
- draw_pixel(f, x, y, makergb(0xff, 0xa0, 0x20, ((float)ctxt->longevity / ctxt->lifetime)));
+ fb_fragment_put_pixel_unchecked(f, x, y, makergb(0xff, 0xa0, 0x20, ((float)ctxt->longevity / ctxt->lifetime)));
}
© All Rights Reserved