summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-09-29 01:30:48 +0200
committereray orçunus <erayorcunus@gmail.com>2020-09-29 01:30:48 +0200
commit7646ceeaaaaf86c4be548d531e59cf81f5220e21 (patch)
treea5daa0fa61395b04de2d4fa28d9fc42f6dd560b4 /src/core/common.h
parentRestore All Cars are Heli cheat (diff)
parentMerge pull request #717 from theR4K/miami (diff)
downloadre3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar.gz
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar.bz2
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar.lz
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar.xz
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.tar.zst
re3-7646ceeaaaaf86c4be548d531e59cf81f5220e21.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))