From b08d3b7b1b06fd2e9dd09eef248a10d33b8d1742 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Sat, 6 Mar 2021 13:06:09 +0100 Subject: gst interpolations, particle systems, timing and gui fix --- gst/fxs.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'gst/fxs.h') diff --git a/gst/fxs.h b/gst/fxs.h index 2be62af..5aeb138 100644 --- a/gst/fxs.h +++ b/gst/fxs.h @@ -3,22 +3,52 @@ #include +#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); -- cgit v1.2.3-54-g00ecf