diff options
author | Chris Robinson <[email protected]> | 2011-05-02 18:33:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-02 18:33:32 -0700 |
commit | 9a28402b90c596ccdc7d1a4ee93f5711637bb484 (patch) | |
tree | 109e1ecb409da7ffe13ad5287f37bb24bb8da17d | |
parent | 8c705cc4eaf3a4d2fe14ad2e495bfb41d8acf8b9 (diff) |
Fix non-spatialized mono sources
-rw-r--r-- | Alc/ALu.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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)) |