diff options
Diffstat (limited to 'standard.c')
-rw-r--r-- | standard.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -135,6 +135,20 @@ int flerp(int a, int b, int t) { return a + ((t * (b - a)) >> fbits); } +void vec_minise(int* x, int* y) { + if ( + absolute(*x) <= fscale_lower_limit || + absolute(*y) <= fscale_lower_limit) { + *x *= fscale_factor; + *y *= fscale_factor; + } else if ( + absolute(*x) > fscale_upper_limit || + absolute(*y) > fscale_upper_limit) { + *x /= fscale_factor; + *y /= fscale_factor; + } +} + void vec_nrmise(int* x, int* y) { int l; |