diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-09-29 01:30:48 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-09-29 01:30:48 +0200 |
commit | 7646ceeaaaaf86c4be548d531e59cf81f5220e21 (patch) | |
tree | a5daa0fa61395b04de2d4fa28d9fc42f6dd560b4 /src/core/common.h | |
parent | Restore All Cars are Heli cheat (diff) | |
parent | Merge pull request #717 from theR4K/miami (diff) | |
download | re3-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.h | 2 |
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)) |