aboutsummaryrefslogtreecommitdiff
path: root/gst/fxs.c
diff options
context:
space:
mode:
authorjacopo grandi <jak.sk8@hotmail.it>2021-02-24 18:01:08 +0100
committerjacopo grandi <jak.sk8@hotmail.it>2021-02-24 18:01:08 +0100
commitdad432566a5c74f86dc4ba874e631115e0f469d1 (patch)
tree0e282e874ef48658d87e82041afe7bba1db3704a /gst/fxs.c
parent0b338bbd007048551526ab4fa4130d53b414e650 (diff)
level selector and fx fic
Diffstat (limited to 'gst/fxs.c')
-rw-r--r--gst/fxs.c5
1 files changed, 4 insertions, 1 deletions
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],