Play zero-distance/zero-radius sources from the front

This commit is contained in:
Chris Robinson 2014-11-05 04:48:48 -08:00
parent 6aed34cfb5
commit 61a56ce120

View File

@ -995,17 +995,17 @@ ALvoid CalcSourceParams(ALvoice *voice, const ALsource *ALSource, const ALCconte
else
{
MixGains *gains = voice->Direct.Mix.Gains[0];
ALfloat radius = ALSource->Radius;
ALfloat Target[MaxChannels];
/* Normalize the length, and compute panned gains. */
if(!(Distance > FLT_EPSILON))
if(!(Distance > FLT_EPSILON) && !(radius > FLT_EPSILON))
{
Position[0] = Position[1] = Position[2] = 0.0f;
ComputeAmbientGains(Device, DryGain, Target);
const ALfloat front[3] = { 0.0f, 0.0f, -1.0f };
ComputeDirectionalGains(Device, front, DryGain, Target);
}
else
{
ALfloat radius = ALSource->Radius;
ALfloat invlen = 1.0f/maxf(Distance, radius);
Position[0] *= invlen;
Position[1] *= invlen;