diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-09-27 03:22:59 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-09-27 03:22:59 +0200 |
commit | b956be0f44930fe1d764c07e680f7cee47c1587a (patch) | |
tree | 42f30e3ff2f159f2b2a7ff21fe374a1b11350828 /src/core | |
parent | correction of defects and another two audio functions (diff) | |
download | re3-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 '')
-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)) |