summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-08-12 12:01:07 +0200
committerSergeanur <s.anureev@yandex.ua>2021-08-12 12:01:07 +0200
commit033d89a9ab6660f15798344af15cdabef8e872b8 (patch)
tree3ca6e0af1456083d892dbcd978c8cbfc785d3c1e /src/core
parentRename unused audio member (diff)
downloadre3-033d89a9ab6660f15798344af15cdabef8e872b8.tar
re3-033d89a9ab6660f15798344af15cdabef8e872b8.tar.gz
re3-033d89a9ab6660f15798344af15cdabef8e872b8.tar.bz2
re3-033d89a9ab6660f15798344af15cdabef8e872b8.tar.lz
re3-033d89a9ab6660f15798344af15cdabef8e872b8.tar.xz
re3-033d89a9ab6660f15798344af15cdabef8e872b8.tar.zst
re3-033d89a9ab6660f15798344af15cdabef8e872b8.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 da162762..3f69a394 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -292,6 +292,8 @@ extern wchar *AllocUnicode(const char*src);
#define Clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
+#define Clamp2(v, center, radius) ((v) > (center) ? Min(v, center + radius) : Max(v, center - radius))
+
inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x))