![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
particle function file for SantaHack 2012 More...
Include dependency graph for n_particles.c:Go to the source code of this file.
Functions | |
| static ALLEGRO_COLOR | _color_lerp (ALLEGRO_COLOR a, ALLEGRO_COLOR b, float t) |
| helper to linearly interpolate a color | |
| static void | _emitter_shape_offset (const PARTICLE_EMITTER *em, double *out_x, double *out_y) |
| compute shape-offset spawn position for an emitter | |
| static double | _particle_rand_range (double vmin, double vmax) |
| helper to generate a random double between min and max | |
| static int | _particle_rand_range_i (int imin, int imax) |
| helper to generate a random int between min and max (inclusive) | |
| PARTICLE_EMITTER * | add_emitter (PARTICLE_SYSTEM *psys) |
| add a new emitter to the particle system | |
| int | add_particle (PARTICLE_SYSTEM *psys, int spr, int mode, int lifetime, int size, ALLEGRO_COLOR color, PHYSICS object) |
| add a particle to a particle system | |
| int | add_particle_at (PARTICLE_SYSTEM *psys, int spr, int mode, double px, double py, double pz, int lifetime, int size_start, int size_end, ALLEGRO_COLOR color_start, ALLEGRO_COLOR color_end, double vx, double vy, double vz, double ax, double ay, double az) |
| add a particle at an absolute world position (not relative to psys->source) | |
| int | add_particle_ex (PARTICLE_SYSTEM *psys, int spr, int mode, int off_x, int off_y, int lifetime, int size, ALLEGRO_COLOR color, double vx, double vy, double vz, double ax, double ay, double az) |
| add a particle to a particle system, all in line version (you have to set the PHYSICS object parameter in the function parameter instead of providing a PHYSICS object) | |
| int | draw_particle (PARTICLE_SYSTEM *psys, double xpos, double ypos, int w, int h, double range) |
| draw particles of a particle system | |
| int | free_emitters (PARTICLE_SYSTEM *psys) |
| free all emitters in the particle system | |
| int | free_particle_system (PARTICLE_SYSTEM **psys) |
| destroy and free a particle system | |
| int | init_particle_system (PARTICLE_SYSTEM **psys, int max, double x, double y, double z, int max_sprites) |
| initialize a particle system | |
| int | manage_particle (PARTICLE_SYSTEM *psys) |
| update particles positions using particle system internal timer | |
| int | manage_particle_ex (PARTICLE_SYSTEM *psys, double delta_t) |
| update particles positions using provided delta time | |
| int | move_particles (PARTICLE_SYSTEM *psys, double vx, double vy, double vz) |
| move all particles of a particle system by a given offset | |
| int | remove_emitter (PARTICLE_SYSTEM *psys, const PARTICLE_EMITTER *em) |
| remove an emitter from the particle system and free it | |
particle function file for SantaHack 2012
Definition in file n_particles.c.
|
static |
helper to linearly interpolate a color
| a | start color |
| b | end color |
| t | interpolation factor [0..1] |
Definition at line 225 of file n_particles.c.
Referenced by manage_particle_ex().
Here is the caller graph for this function:
|
static |
compute shape-offset spawn position for an emitter
| em | the emitter |
| out_x | output x offset |
| out_y | output y offset |
Definition at line 157 of file n_particles.c.
References PARTICLE_EMITTER::shape, PARTICLE_EMITTER::shape_h, PARTICLE_EMITTER::shape_rotation, and PARTICLE_EMITTER::shape_w.
Referenced by manage_particle_ex().
Here is the caller graph for this function:
|
static |
helper to generate a random double between min and max
| vmin | minimum value |
| vmax | maximum value |
Definition at line 202 of file n_particles.c.
Referenced by manage_particle_ex().
Here is the caller graph for this function:
|
static |
helper to generate a random int between min and max (inclusive)
| imin | minimum value |
| imax | maximum value |
Definition at line 213 of file n_particles.c.
Referenced by manage_particle_ex().
Here is the caller graph for this function: