Update Makefile.
[runemen.git] / src / SDL2_particles.h
blob72223abaf7baede993c3e9d4a7486381b9be2ff7
1 #ifndef _SDL2_PARTICLES_H
2 #define _SDL2_PARTICLES_H
4 #include <SDL.h>
6 #define PARTICLES_PER_SYSTEM 255
8 typedef struct particle_t {
9 float x;
10 float y;
11 Sint32 ttl;
12 float ang;
13 Uint32 spd;
14 Uint32 size;
15 } particle_t;
17 typedef struct particle_system {
18 Sint16 x;
19 Sint16 y;
20 particle_t particle[PARTICLES_PER_SYSTEM];
21 Uint16 limit;
22 Uint16 spawn;
23 void (*init)(particle_t *part);
24 void (*move)(particle_t *part);
25 void (*reset)(particle_t *part);
26 } particle_system;
28 extern void PS_Update(particle_system *ps);
29 extern void PS_Render(SDL_Renderer *target, particle_system *ps, SDL_Color *colors, int num_colors, Uint32 bx, Uint32 by);
31 /* default handlers */
32 extern void basic_particle_init(particle_t *p);
33 extern void basic_particle_move(particle_t *p);
34 extern void basic_particle_reset(particle_t *p);
36 #endif /* _SDL2_PARTICLES_H */