diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-03-06 13:06:09 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-03-06 13:06:09 +0100 |
commit | b08d3b7b1b06fd2e9dd09eef248a10d33b8d1742 (patch) | |
tree | 2ccf6805d2048a5e88f4a941a5a35e19be26eaf9 /gst/fxs.h | |
parent | e3350de3a2d90922c2b16e5b5e819f259adb3588 (diff) |
gst interpolations, particle systems, timing and gui fix
Diffstat (limited to 'gst/fxs.h')
-rw-r--r-- | gst/fxs.h | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -3,22 +3,52 @@ #include <SDL2/SDL.h> +#define FXS_BULLET_MAX 4096 +#define FXS_EXPLOSION_MAX 2048 + typedef struct { float from[2]; float to[2]; float starttime; float endtime; float size; - int color[3]; + float color[3]; } bullet; typedef struct { + float pos[2]; + float vel[2]; + float color[3]; + float size; + float mass; + float lifetime; +} particle; + +typedef struct { + float pos[2]; + float force[2]; + float friction; + particle parts[32]; + int partslen; + float starttime; +} explosion; + +typedef struct { bullet *bullets; int bulletslen; + explosion *explosions; + int explosionslen; } fxs; void fx_init (fxs *fx); + void fx_add_bullet (fxs *fx, bullet *b); + +void fx_explosion_init (fxs *fx, explosion *e, + float pos[], float vel[], float color[], float force[], + float spread, float speed, int n, float time, float lifetime); +void fx_add_explosion (fxs *fx, explosion *e); + void fx_process (fxs *fx, float time); void fx_render (SDL_Renderer *rend, fxs *fx, float cam[], float time); |