diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-08-29 15:56:40 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-08-29 15:56:40 +0200 |
commit | 431b7ed0b7764db732e39802a40d94dfe9f2108b (patch) | |
tree | f3f5ab4a7b1f2838733004d8294e571b777e631f /Tools/AnvilStats/Globals.h | |
parent | Added new console command with cleanup (diff) | |
parent | VanillaFluidSimulator: Fixed an invalid Y-coord query. (diff) | |
download | cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.gz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.bz2 cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.lz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.xz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.zst cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.zip |
Diffstat (limited to 'Tools/AnvilStats/Globals.h')
-rw-r--r-- | Tools/AnvilStats/Globals.h | 11 |
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" |