diff options
author | Mattes D <github@xoft.cz> | 2014-08-27 11:32:51 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-08-27 11:32:51 +0200 |
commit | 3da27fb7a3f45bc5a82bba13e9b836c8b3dca6a5 (patch) | |
tree | f5ababf68358785f38268f7b21442b0f7c13790b /Tools/AnvilStats/Globals.h | |
parent | AnvilStats: Rewritten to use CMake. (diff) | |
parent | AnvilStats: Fixed thread start race condition. (diff) | |
download | cuberite-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.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" |