diff options
author | Chris Robinson <[email protected]> | 2009-04-11 20:27:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-04-11 20:27:55 -0700 |
commit | 65b69f33085ac9381f683e92655acba0e4622675 (patch) | |
tree | d60a8ed6615acb91f851b52dc441dd21963b893f /Alc | |
parent | c67fbd72dd9cb2dcc21b690c94ff8dc39bc0d34a (diff) |
Fix air absorption
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -710,8 +710,21 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext, break; } + // Source Gain + Attenuation and clamp to Min/Max Gain + DryMix = SourceVolume * flAttenuation; + DryMix = __min(DryMix,MaxVolume); + DryMix = __max(DryMix,MinVolume); + + for(i = 0;i < MAX_SENDS;i++) + { + ALfloat WetMix = SourceVolume * RoomAttenuation[i]; + WetMix = __min(WetMix,MaxVolume); + wetsend[i] = __max(WetMix,MinVolume); + wetgainhf[i] = 1.0f; + } + // Distance-based air absorption - if(ALSource->AirAbsorptionFactor > 0.0f && ALContext->DistanceModel != AL_NONE) + if(ALSource->AirAbsorptionFactor > 0.0f && ALSource->DistanceModel != AL_NONE) { ALfloat dist = Distance-MinDist; ALfloat absorb; @@ -727,19 +740,6 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext, wetgainhf[i] *= absorb; } - // Source Gain + Attenuation and clamp to Min/Max Gain - DryMix = SourceVolume * flAttenuation; - DryMix = __min(DryMix,MaxVolume); - DryMix = __max(DryMix,MinVolume); - - for(i = 0;i < MAX_SENDS;i++) - { - ALfloat WetMix = SourceVolume * RoomAttenuation[i]; - WetMix = __min(WetMix,MaxVolume); - wetsend[i] = __max(WetMix,MinVolume); - wetgainhf[i] = 1.0f; - } - //3. Apply directional soundcones Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * 180.0f/M_PI; if(Angle >= InnerAngle && Angle <= OuterAngle) |