diff options
Diffstat (limited to 'source/math.h')
-rwxr-xr-x | source/math.h | 13 |
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 { |