From 85127285bff6983665275fe14d3c2b80b36a872a Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 11 Sep 2020 00:48:13 -0700 Subject: module/sparkler: implement some BSP drawing settings This commit adds a few settings for visualizing the octree BSP: show_bsp_leafs (on/off): Draw wireframe cubes around octree leaf nodes show_bsp_leafs_min_depth (0,4,6,8,10): Set minimum octree depth for leaf nodes displayed show_bsp_matches (on/off): Draw lines connecting BSP search matches show_bsp_matches_affected_only (on/off): Limit drawn BSP search matches to only matches actually affected by the simulation The code implementing this stuff is a bit crufty, fb_fragment_t had to be pulled down to the sim ops for example and whether that actually results in drawing occurring during the sim phase depends on the config used and how the particle implementations react to the config... it's just gross. This matters because the caller used to know only the draw phase touched fb_fragment_t, and because of that the fragment was zeroed after sim and before draw in parallel. But now the caller needs to know if the config would make sim do some drawing, and do the fragment zeroing before sim instead, and skip the zero before draw to not lose what sim drew. It's icky, but I'll leave it for now, at least it's isolated to the sparkler. --- src/modules/sparkler/xplode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/sparkler/xplode.c') diff --git a/src/modules/sparkler/xplode.c b/src/modules/sparkler/xplode.c index 8b191cd..4d6ee36 100644 --- a/src/modules/sparkler/xplode.c +++ b/src/modules/sparkler/xplode.c @@ -21,7 +21,7 @@ typedef struct _xplode_ctxt_t { } xplode_ctxt_t; -static int xplode_init(particles_t *particles, particle_t *p) +static int xplode_init(particles_t *particles, const particles_conf_t *conf, particle_t *p) { xplode_ctxt_t *ctxt = p->ctxt; @@ -36,7 +36,7 @@ static int xplode_init(particles_t *particles, particle_t *p) } -static particle_status_t xplode_sim(particles_t *particles, particle_t *p) +static particle_status_t xplode_sim(particles_t *particles, const particles_conf_t *conf, particle_t *p, fb_fragment_t *f) { xplode_ctxt_t *ctxt = p->ctxt; @@ -57,7 +57,7 @@ static particle_status_t xplode_sim(particles_t *particles, particle_t *p) } -static void xplode_draw(particles_t *particles, particle_t *p, int x, int y, fb_fragment_t *f) +static void xplode_draw(particles_t *particles, const particles_conf_t *conf, particle_t *p, int x, int y, fb_fragment_t *f) { xplode_ctxt_t *ctxt = p->ctxt; uint32_t color; -- cgit v1.2.1