summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/Globals.h
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2014-10-11 19:32:21 +0200
committerAlexander Harkness <bearbin@gmail.com>2014-10-11 19:32:21 +0200
commit93833069a80fe4aec33a95148df39ad40671ddaf (patch)
tree2e6a335a60e618b5fe456ca8a586a2c5448c8c87 /Tools/AnvilStats/Globals.h
parentReverted submodule changes. (diff)
parentMerge pull request #1528 from kjanku1/master (diff)
downloadcuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.gz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.bz2
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.lz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.xz
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.tar.zst
cuberite-93833069a80fe4aec33a95148df39ad40671ddaf.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"