diff options
author | Chris Robinson <[email protected]> | 2011-05-15 00:18:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-15 00:18:28 -0700 |
commit | 949cfe2ceb7ada5f7ab9b1ad9df795c817717b82 (patch) | |
tree | 5a8392ea6d927dded5fcbbc1c4a6b432b3ce110b /Alc/ALu.c | |
parent | c39f27d5f89f278a09b05f3dfdc9a3f245a0f9af (diff) |
Re-enable duplication for stereo sounds
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -213,6 +213,25 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } } } + else if((ALContext->Device->Flags&DEVICE_DUPLICATE_STEREO)) + { + static const ALfloat angles_StereoDup[4] = { -30.0f, -150.0f, + 30.0f, 150.0f }; + DryGain *= aluSqrt(2.0f/4.0f); + for(c = 0;c < 4;c++) + { + pos = aluCart2LUTpos(cos(angles_StereoDup[c] * (M_PI/180.0)), + sin(angles_StereoDup[c] * (M_PI/180.0))); + SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos]; + + for(i = 0;i < (ALint)Device->NumChan;i++) + { + Channel chan = Device->Speaker2Chan[i]; + SrcMatrix[c>>1][chan] += DryGain * ListenerGain * + SpeakerGain[chan]; + } + } + } else { for(c = 0;c < 2;c++) |