diff options
author | Chris Robinson <[email protected]> | 2016-08-23 19:17:17 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-08-23 19:17:17 -0700 |
commit | c7eb0b7393231a137c31f75e0654214a08bc51a9 (patch) | |
tree | 478977dfab7d734ec68c8a35520ed2c4d3ab32fa /Alc/ALu.c | |
parent | dc8b7814c771d08abe61656b745e7763a010a3a3 (diff) |
Don't pass the context's distance model as the source's
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -278,6 +278,9 @@ static ALboolean CalcListenerParams(ALCcontext *Context) Listener->Params.SpeedOfSound = ATOMIC_LOAD(&props->SpeedOfSound, almemory_order_relaxed) * ATOMIC_LOAD(&props->DopplerVelocity, almemory_order_relaxed); + Listener->Params.SourceDistanceModel = ATOMIC_LOAD(&props->SourceDistanceModel, almemory_order_relaxed); + Listener->Params.DistanceModel = ATOMIC_LOAD(&props->DistanceModel, almemory_order_relaxed); + /* WARNING: A livelock is theoretically possible if another thread keeps * changing the freelist head without giving this a chance to actually swap * in the old container (practically impossible with this little code, @@ -939,7 +942,9 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALsourceProps *pro Attenuation = 1.0f; for(i = 0;i < NumSends;i++) RoomAttenuation[i] = 1.0f; - switch(ATOMIC_LOAD(&props->DistanceModel, almemory_order_relaxed)) + switch(Listener->Params.SourceDistanceModel ? + ATOMIC_LOAD(&props->DistanceModel, almemory_order_relaxed) : + Listener->Params.DistanceModel) { case InverseDistanceClamped: ClampedDist = clampf(ClampedDist, MinDist, MaxDist); |