summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-09-29 00:48:11 +0200
committerGitHub <noreply@github.com>2020-09-29 00:48:11 +0200
commite2314c7852c47d93ae1ba36398cecff12d73568a (patch)
tree00ec667839570abc5be30eba825e56e89bc6f31f /src/core
parentMerge pull request #721 from theR4K/miamiUpstream (diff)
parentTEMPORALY remove flying cars (diff)
downloadre3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar.gz
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar.bz2
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar.lz
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar.xz
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.tar.zst
re3-e2314c7852c47d93ae1ba36398cecff12d73568a.zip
Diffstat (limited to 'src/core')
-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))