summaryrefslogtreecommitdiff
path: root/source/math.h
diff options
context:
space:
mode:
authortalha <sarcxd@gmail.com>2025-01-28 22:01:29 +0500
committertalha <sarcxd@gmail.com>2025-01-28 22:01:29 +0500
commit8c772d074915714aa059517971eb770f48edad40 (patch)
treedb70f16ec45fff63eef38a2ce8bb62d8fe737541 /source/math.h
parent35a471880543a117b70c44d5e230ae2b3d56a037 (diff)
Updated level_handling:
- automatically load the next level once goal is reached
Diffstat (limited to 'source/math.h')
-rwxr-xr-xsource/math.h13
1 files changed, 13 insertions, 0 deletions
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 {