diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-30 16:00:49 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-30 16:00:49 +0000 |
commit | d09a1be33a647aedc12ce5ddcb7ea4ee23a75c8c (patch) | |
tree | 8fe9d8778223e22e8c957b59c51bccabb98d2b94 /src/math/functions.h | |
parent | ad436de3a520fb2469dafe23afe03dd0afe8d189 (diff) |
various minor issues: ESC closing chat, g_autolevel
Diffstat (limited to 'src/math/functions.h')
-rw-r--r-- | src/math/functions.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/math/functions.h b/src/math/functions.h index 3d5d056..be6919d 100644 --- a/src/math/functions.h +++ b/src/math/functions.h @@ -49,9 +49,12 @@ float degrees180f(float angle); float degrees360f(float angle); /// clamp a float to a specified range -inline void clamp(float &value, float min=0.0f, float max=1.0f) +inline void clamp(float &value, const float min=0.0f, const float max=1.0f) { - if (value < min) value = min; else if (value > max) value = max; + if (value < min) + value = min; + else if (value > max) + value = max; } /// return the absolute value of a float |