From dad432566a5c74f86dc4ba874e631115e0f469d1 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Wed, 24 Feb 2021 18:01:08 +0100 Subject: level selector and fx fic --- gst/fxs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gst/fxs.c') diff --git a/gst/fxs.c b/gst/fxs.c index 2078a89..ad4d15a 100644 --- a/gst/fxs.c +++ b/gst/fxs.c @@ -39,7 +39,10 @@ void fx_render (SDL_Renderer *rend, fxs *fx, float cam[], float time) { b->from[1] *(1-amt) + b->to[1] *amt }; float head[2]; vec2_sub(head, b->from, b->to); - vec2_norm(head); vec2_mul(head, head, 10); + float mag = 10; + float dist = amt*vec2_mag(head); + if (dist < 10) { mag = dist; } + vec2_norm(head); vec2_mul(head, head, mag); SDL_SetRenderDrawColor(rend, b->color[0], b->color[1], -- cgit v1.2.3-54-g00ecf