From d783753cb5050e3a16363cd8a2bfb4b361c130c0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 27 Aug 2014 09:46:59 +0200 Subject: AnvilStats: initial per-height blocktype implementation (WIP). --- Tools/AnvilStats/Globals.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Tools/AnvilStats/Globals.h') 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 +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" -- cgit v1.2.3