summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/sparkler/particles.c6
-rw-r--r--src/modules/sparkler/particles.h7
-rw-r--r--src/modules/sparkler/sparkler.c2
3 files changed, 12 insertions, 3 deletions
diff --git a/src/modules/sparkler/particles.c b/src/modules/sparkler/particles.c
index 8ebb61d..b43c57b 100644
--- a/src/modules/sparkler/particles.c
+++ b/src/modules/sparkler/particles.c
@@ -40,11 +40,12 @@ struct particles_t {
chunker_t *chunker; /* chunker for variably-sized particle allocation (includes context) */
list_head_t active; /* top-level active list of particles heirarchy */
bsp_t *bsp; /* bsp spatial index of the particles */
+ particles_conf_t conf;
};
/* create a new particle system */
-particles_t * particles_new(void)
+particles_t * particles_new(const particles_conf_t *conf)
{
particles_t *particles;
@@ -65,6 +66,9 @@ particles_t * particles_new(void)
INIT_LIST_HEAD(&particles->active);
+ if (conf)
+ particles->conf = *conf;
+
return particles;
}
diff --git a/src/modules/sparkler/particles.h b/src/modules/sparkler/particles.h
index 689934b..b191b6e 100644
--- a/src/modules/sparkler/particles.h
+++ b/src/modules/sparkler/particles.h
@@ -6,9 +6,14 @@
#include "list.h"
#include "particle.h"
+typedef struct particles_conf_t {
+ unsigned show_bsp_leafs:1;
+ unsigned show_bsp_matches:1;
+} particles_conf_t;
+
typedef struct particles_t particles_t;
-particles_t * particles_new(void);
+particles_t * particles_new(const particles_conf_t *conf);
void particles_draw(particles_t *particles, fb_fragment_t *fragment);
particle_status_t particles_sim(particles_t *particles);
void particles_age(particles_t *particles);
diff --git a/src/modules/sparkler/sparkler.c b/src/modules/sparkler/sparkler.c
index 7c1c2f1..bdee130 100644
--- a/src/modules/sparkler/sparkler.c
+++ b/src/modules/sparkler/sparkler.c
@@ -38,7 +38,7 @@ static void * sparkler_create_context(unsigned ticks, unsigned num_cpus)
if (!ctxt)
return NULL;
- ctxt->particles = particles_new();
+ ctxt->particles = particles_new(NULL);
if (!ctxt->particles) {
free(ctxt);
return NULL;
© All Rights Reserved