diff options
author | Chris Robinson <[email protected]> | 2010-11-28 19:52:17 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-11-28 19:52:17 -0800 |
commit | da4f5c6f96b04094bf37e5c7ac393a7bfbfbb681 (patch) | |
tree | f467c94351e81f7ede5f3ac4847a8cbbe117b516 /Alc/panning.c | |
parent | f09ae196a83c8a64fdd29e60b30dc51a367cb1c9 (diff) |
Uninline some functions
Also add -Winline to the compiler command line to watch for future inline problems
Diffstat (limited to 'Alc/panning.c')
-rw-r--r-- | Alc/panning.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Alc/panning.c b/Alc/panning.c index 5c0f68fd..43c55cad 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -146,6 +146,20 @@ static ALfloat aluLUTpos2Angle(ALint pos) return aluAtan((ALfloat)(pos - 3 * QUADRANT_NUM) / (ALfloat)(4 * QUADRANT_NUM - pos)) - M_PI_2; } +ALint aluCart2LUTpos(ALfloat re, ALfloat im) +{ + ALint pos = 0; + ALfloat denom = aluFabs(re) + aluFabs(im); + if(denom > 0.0f) + pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5); + + if(re < 0.0) + pos = 2 * QUADRANT_NUM - pos; + if(im < 0.0) + pos = LUT_NUM - pos; + return pos%LUT_NUM; +} + ALvoid aluInitPanning(ALCdevice *Device) { ALfloat SpeakerAngle[OUTPUTCHANNELS]; |