diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-24 18:01:08 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-24 18:01:08 +0100 |
commit | dad432566a5c74f86dc4ba874e631115e0f469d1 (patch) | |
tree | 0e282e874ef48658d87e82041afe7bba1db3704a /gst/fxs.c | |
parent | 0b338bbd007048551526ab4fa4130d53b414e650 (diff) |
level selector and fx fic
Diffstat (limited to 'gst/fxs.c')
-rw-r--r-- | gst/fxs.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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], |