another clamp

This commit is contained in:
Roman Masanin committed 2020-09-27 04:22:59 +03:00
1 parent f67275be13
commit b956be0f44
3 files changed
+10 -8

No files matched your search

+2
View File
@@ -219,6 +219,8 @@ extern int strncasecmp(const char *str1, const char *str2, size_t len);
#define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius))
inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x))