diff options
author | Chris Robinson <[email protected]> | 2014-11-05 04:48:48 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-05 04:48:48 -0800 |
commit | 61a56ce120be828e9076060db1958328a3118d83 (patch) | |
tree | fc78f7f02b85ba581b40ff85628c86c313a7f85d | |
parent | 6aed34cfb5a4e8add6a91410b6c8016570796943 (diff) |
Play zero-distance/zero-radius sources from the front
-rw-r--r-- | Alc/ALu.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |