summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-09-29 01:48:11 +0300
committerGitHub <noreply@github.com>2020-09-29 01:48:11 +0300
commite2314c7852c47d93ae1ba36398cecff12d73568a (patch)
tree00ec667839570abc5be30eba825e56e89bc6f31f /src/core
parentbc0bdd02f494b70d64a2d6a6fcf1cce275b5a303 (diff)
parenta729f32c83c93cab54596911e957b0fbee028ebc (diff)
Merge pull request #717 from theR4K/miami
Helicopters not ringing, and other audio stuff
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))