diff options
author | NiLSPACE <NiLSPACE@users.noreply.github.com> | 2019-12-22 23:38:11 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2019-12-22 23:38:11 +0100 |
commit | dc787e1d968058a810ad379013f84c82ea78b2fa (patch) | |
tree | 4b97b7f602f298df05cd634ac663292cc6c8b90b /Tools/NoiseSpeedTest | |
parent | AppVeyor release builds (diff) | |
download | cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar.gz cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar.bz2 cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar.lz cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar.xz cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.tar.zst cuberite-dc787e1d968058a810ad379013f84c82ea78b2fa.zip |
Diffstat (limited to '')
-rw-r--r-- | Tools/NoiseSpeedTest/Globals.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tools/NoiseSpeedTest/Globals.h b/Tools/NoiseSpeedTest/Globals.h index b6b7a4af3..23adeaf26 100644 --- a/Tools/NoiseSpeedTest/Globals.h +++ b/Tools/NoiseSpeedTest/Globals.h @@ -62,6 +62,14 @@ +#ifndef TOLUA_TEMPLATE_BIND + #define TOLUA_TEMPLATE_BIND(x) +#endif + + + + + // Integral types with predefined sizes: typedef long long Int64; typedef int Int32; @@ -225,3 +233,10 @@ public: + +/** Clamps the value into 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); +} |