From 8c772d074915714aa059517971eb770f48edad40 Mon Sep 17 00:00:00 2001 From: talha Date: Tue, 28 Jan 2025 22:01:29 +0500 Subject: Updated level_handling: - automatically load the next level once goal is reached --- source/math.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/math.h') diff --git a/source/math.h b/source/math.h index be1432f..950593d 100755 --- a/source/math.h +++ b/source/math.h @@ -33,6 +33,19 @@ r32 clampf(r32 x, r32 bottom, r32 top) return x; } +u32 clampi(u32 x, u32 bottom, u32 top) +{ + if (x < bottom) + { + x = bottom; + } + else if (x > top) + { + x = top; + } + + return x; +} // ==== Vector Math ==== union IVec2 { -- cgit v1.2.3