diff options
author | Chris Robinson <[email protected]> | 2011-05-07 03:54:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-07 03:54:46 -0700 |
commit | db3cb23c1d9508337852b1f9ca29bc74b6725e9f (patch) | |
tree | 30af40ee360638c2c56dc12291c3280ce188c302 /Alc/ALu.c | |
parent | 7972f7a2da68fdb3ecedf34616d6b2b01dee80de (diff) |
Add an option to reverse Z panning of mono sources
Applications that are not built around OpenAL's orientation system need to
convert their given vectors to it. Depending on how this is done, it can lead
to proper stereo (left-right) panning with improper surround sound (front-back)
panning, which thusly sounds correct with stereo output and incorrect with 4+
channel output.
This option is intended to help fix playback of such applications on surround
sound systems, without having to resort to forcing stereo output.
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -822,8 +822,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) { const ALshort *hrtf_left, *hrtf_right; - GetHrtfCoeffs(atan2(Position[1], -Position[2]) * (180.0/M_PI), - atan2(Position[0], -Position[2]) * (180.0/M_PI), + GetHrtfCoeffs(atan2(Position[1], -Position[2]*ZScale) * (180.0/M_PI), + atan2(Position[0], -Position[2]*ZScale) * (180.0/M_PI), &hrtf_left, &hrtf_right); for(i = 0;i < HRTF_LENGTH;i++) { @@ -835,7 +835,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } else { - pos = aluCart2LUTpos(-Position[2], Position[0]); + pos = aluCart2LUTpos(-Position[2]*ZScale, Position[0]); SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos]; DirGain = aluSqrt(Position[0]*Position[0] + Position[2]*Position[2]); |