summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/Globals.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-27 09:46:59 +0200
committermadmaxoft <github@xoft.cz>2014-08-27 09:46:59 +0200
commitd783753cb5050e3a16363cd8a2bfb4b361c130c0 (patch)
tree14b05fff50f7fc13a9569da475ed5a1ee0042ca2 /Tools/AnvilStats/Globals.h
parentAnvilStats: Rewritten to use CMake. (diff)
downloadcuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar.gz
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar.bz2
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar.lz
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar.xz
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.tar.zst
cuberite-d783753cb5050e3a16363cd8a2bfb4b361c130c0.zip
Diffstat (limited to '')
-rw-r--r--Tools/AnvilStats/Globals.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Tools/AnvilStats/Globals.h b/Tools/AnvilStats/Globals.h
index df1430cc4..21d54739a 100644
--- a/Tools/AnvilStats/Globals.h
+++ b/Tools/AnvilStats/Globals.h
@@ -241,6 +241,17 @@ public:
+/** Clamp value to the specified range. */
+template <typename T>
+T Clamp(T a_Value, T a_Min, T a_Max)
+{
+ return (a_Value < a_Min) ? a_Min : ((a_Value > a_Max) ? a_Max : a_Value);
+}
+
+
+
+
+
// Common headers (part 2, with macros):
#include "../../src/ChunkDef.h"
#include "../../src/BlockID.h"