a-game

2D platformer written from scratch.
Log | Files | Refs | README | LICENSE

commit cd3370ddbf739ad76efa3e4a62a031624c78f05d
parent fe6f8a63865573bef820273bf49389dcc9e95189
Author: Amin Mesbah <dev@aminmesbah.com>
Date:   Sun,  2 Jun 2019 15:37:27 -0700

Make wrap actually wrap, not just clamp

Diffstat:
Msrc/am_math.h | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/am_math.h b/src/am_math.h @@ -26,11 +26,11 @@ internal inline f32 math_wrap(f32 n, f32 min, f32 max) { if (n > max) { - return min; + return n - max; } else if (n < min) { - return max; + return n + max; } else {