diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2023-08-30 13:45:07 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-30 13:49:54 -0700 |
commit | 20d097ab1fe8ef5b62f4169f4353cc0074c27e4b (patch) | |
tree | 412f1069b7a3fa3953df02b54302bbdca3ddf6fb /src/modules/sparkler/particles.h | |
parent | a634b2df74222be85a03b1895ee10135822031c3 (diff) |
sparkler: parameterize particles
Having everything in fixed defines severely constrains the
diversity of particle behaviors and appearances.
This commit has been sitting around bitrotting since 2017, but
now that there's all this settings infra. and randomizing via
rtv, it seems worth landing, so I've rebased and am merging to
prevent a bitrot->rebase recurrence.
As-is, this commit ~minimally establishes a somewhat streamlined
parameterizing mechanism w/X-Macro patterns, while wiring up a
few of the obvious use cases surrounding xplode/burst, colorizing
the default sparkler explosions while at it.
It appears that when I first hacked this up I did some
experimentation with parameters as well, so there are some tweaks
to the behavior as opposed to a strict conversion of the fixed
defines to parameters. They seem minor enough to just leave be.
Plus a few minor optimizations like converting divides to
multiplies were in there.
Future commits can now wire up settings to choose from parameter
presets for different sparklers...
Diffstat (limited to 'src/modules/sparkler/particles.h')
-rw-r--r-- | src/modules/sparkler/particles.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/sparkler/particles.h b/src/modules/sparkler/particles.h index a419e2c..d3add36 100644 --- a/src/modules/sparkler/particles.h +++ b/src/modules/sparkler/particles.h @@ -23,9 +23,9 @@ void particles_draw(particles_t *particles, til_fb_fragment_t *fragment); particle_status_t particles_sim(particles_t *particles, til_fb_fragment_t *fragment); void particles_age(particles_t *particles); void particles_free(particles_t *particles); -int particles_add_particle(particles_t *particles, particle_props_t *props, particle_ops_t *ops); -void particles_spawn_particle(particles_t *particles, particle_t *parent, particle_props_t *props, particle_ops_t *ops); -void particles_add_particles(particles_t *particles, particle_props_t *props, particle_ops_t *ops, int num); +int particles_add_particle(particles_t *particles, particle_props_t *props, particle_ops_t *ops, unsigned n_params, ...); +void particles_spawn_particle(particles_t *particles, particle_t *parent, particle_props_t *props, particle_ops_t *ops, unsigned n_params, ...); +void particles_add_particles(particles_t *particles, particle_props_t *props, particle_ops_t *ops, unsigned num, unsigned n_params, ...); bsp_t * particles_bsp(particles_t *particles); void particles_draw_line(particles_t *particles, const v3f_t *a, const v3f_t *b, til_fb_fragment_t *fragment); |