summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/Globals.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-27 11:32:51 +0200
committerMattes D <github@xoft.cz>2014-08-27 11:32:51 +0200
commit3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5 (patch)
treef5ababf68358785f38268f7b21442b0f7c13790b /Tools/AnvilStats/Globals.h
parentAnvilStats: Rewritten to use CMake. (diff)
parentAnvilStats: Fixed thread start race condition. (diff)
downloadcuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar.gz
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar.bz2
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar.lz
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar.xz
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.tar.zst
cuberite-3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5.zip
Diffstat (limited to 'Tools/AnvilStats/Globals.h')
-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"