summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-26 20:11:59 -0700
committerChris Robinson <[email protected]>2012-10-26 20:11:59 -0700
commit3c3e3b123b6d3a3e220fc6db9707f449aff07010 (patch)
tree7fc4d1f2d2da785eece850d537011a352dc24139 /Alc
parentf02a9935c65efbad9a0387b288df008a7f1ebf91 (diff)
Add a couple comments to the code
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 4dd4c7dc..ec7c0ffd 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -908,8 +908,10 @@ static __inline ALfloat aluF2F(ALfloat val)
{ return val; }
static __inline ALint aluF2I(ALfloat val)
{
+ /* Clamp the value between -1 and +1. This handles that without branching. */
val = val+1.0f - fabsf(val-1.0f);
val = (val-2.0f + fabsf(val+2.0f)) * 0.25;
+ /* Convert to a signed integer, between -2147483647 and +2147483647. */
return fastf2i((ALfloat)(val*2147483647.0));
}
static __inline ALuint aluF2UI(ALfloat val)