aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-05 04:48:48 -0800
committerChris Robinson <[email protected]>2014-11-05 04:48:48 -0800
commit61a56ce120be828e9076060db1958328a3118d83 (patch)
treefc78f7f02b85ba581b40ff85628c86c313a7f85d
parent6aed34cfb5a4e8add6a91410b6c8016570796943 (diff)
Play zero-distance/zero-radius sources from the front
-rw-r--r--Alc/ALu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index f9e143da..cf8bfcfb 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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;