diff options
-rw-r--r-- | Alc/ALu.c | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 7 |
2 files changed, 11 insertions, 0 deletions
@@ -71,6 +71,10 @@ extern inline ALuint64 minu64(ALuint64 a, ALuint64 b); extern inline ALuint64 maxu64(ALuint64 a, ALuint64 b); extern inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max); +extern inline size_t minz(size_t a, size_t b); +extern inline size_t maxz(size_t a, size_t b); +extern inline size_t clampz(size_t val, size_t min, size_t max); + extern inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu); extern inline ALfloat cubic(ALfloat val1, ALfloat val2, ALfloat val3, ALfloat val4, ALfloat mu); diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index e450d68e..a6e0efa8 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -385,6 +385,13 @@ inline ALuint64 maxu64(ALuint64 a, ALuint64 b) inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) { return minu64(max, maxu64(min, val)); } +inline size_t minz(size_t a, size_t b) +{ return ((a > b) ? b : a); } +inline size_t maxz(size_t a, size_t b) +{ return ((a > b) ? a : b); } +inline size_t clampz(size_t val, size_t min, size_t max) +{ return minz(max, maxz(min, val)); } + inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) { |