diff options
author | Chris Robinson <[email protected]> | 2013-11-27 00:30:13 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-11-27 00:30:13 -0800 |
commit | 08dfbcfd5c61bc07db428e001a7a9e880d618335 (patch) | |
tree | 073a07eec91553fcfb586143e5df49171133918a | |
parent | d33912014596b76e95045891f3d4942cb95cf519 (diff) |
Add min/max/clamp methods for doubles
-rw-r--r-- | Alc/ALu.c | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 7 |
2 files changed, 11 insertions, 0 deletions
@@ -52,6 +52,10 @@ extern inline ALfloat minf(ALfloat a, ALfloat b); extern inline ALfloat maxf(ALfloat a, ALfloat b); extern inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max); +extern inline ALdouble mind(ALdouble a, ALdouble b); +extern inline ALdouble maxd(ALdouble a, ALdouble b); +extern inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max); + extern inline ALuint minu(ALuint a, ALuint b); extern inline ALuint maxu(ALuint a, ALuint b); extern inline ALuint clampu(ALuint val, ALuint min, ALuint max); diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 075d5569..d88e860c 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -64,6 +64,13 @@ inline ALfloat maxf(ALfloat a, ALfloat b) inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max) { return minf(max, maxf(min, val)); } +inline ALdouble mind(ALdouble a, ALdouble b) +{ return ((a > b) ? b : a); } +inline ALdouble maxd(ALdouble a, ALdouble b) +{ return ((a > b) ? a : b); } +inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max) +{ return mind(max, maxd(min, val)); } + inline ALuint minu(ALuint a, ALuint b) { return ((a > b) ? b : a); } inline ALuint maxu(ALuint a, ALuint b) |