aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-02 18:33:32 -0700
committerChris Robinson <[email protected]>2011-05-02 18:33:32 -0700
commit9a28402b90c596ccdc7d1a4ee93f5711637bb484 (patch)
tree109e1ecb409da7ffe13ad5287f37bb24bb8da17d
parent8c705cc4eaf3a4d2fe14ad2e495bfb41d8acf8b9 (diff)
Fix non-spatialized mono sources
-rw-r--r--Alc/ALu.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 80fb1d1a..07eb9315 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -158,7 +158,21 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
switch(Channels)
{
case FmtMono:
- SrcMatrix[0][FRONT_CENTER] = DryGain * ListenerGain;
+ if((ALContext->Device->Flags&DEVICE_USE_HRTF))
+ {
+ const ALshort *hrtf_left, *hrtf_right;
+
+ GetHrtfCoeffs(0.0, 0.0, &hrtf_left, &hrtf_right);
+ for(i = 0;i < HRTF_LENGTH;i++)
+ {
+ ALSource->Params.HrtfCoeffs[0][i][0] =
+ hrtf_left[i]*(1.0/32767.0)*DryGain*ListenerGain;
+ ALSource->Params.HrtfCoeffs[0][i][1] =
+ hrtf_right[i]*(1.0/32767.0)*DryGain*ListenerGain;
+ }
+ }
+ else
+ SrcMatrix[0][FRONT_CENTER] = DryGain * ListenerGain;
break;
case FmtStereo:
if((ALContext->Device->Flags&DEVICE_USE_HRTF))