summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-09-27 03:22:59 +0200
committerRoman Masanin <36927roma@gmail.com>2020-09-27 03:22:59 +0200
commitb956be0f44930fe1d764c07e680f7cee47c1587a (patch)
tree42f30e3ff2f159f2b2a7ff21fe374a1b11350828 /src/core/common.h
parentcorrection of defects and another two audio functions (diff)
downloadre3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar.gz
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar.bz2
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar.lz
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar.xz
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.tar.zst
re3-b956be0f44930fe1d764c07e680f7cee47c1587a.zip
Diffstat (limited to 'src/core/common.h')
-rw-r--r--src/core/common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/common.h b/src/core/common.h
index ba1d24ef..0a2a236e 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -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))