aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-05 03:55:16 -0700
committerChris Robinson <[email protected]>2011-07-05 03:55:16 -0700
commit4c35bfbc10ec58828b1c83c88d53721dcd49eb32 (patch)
treeadb01aa5a36be9ee63017ea05740903b0958991e
parent83e322c5f3d638c478e1f969ea717a161a5dded3 (diff)
Read the source's RoomRolloffFactor once
-rw-r--r--Alc/ALu.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d6129c10..42c18e86 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -390,27 +390,28 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
//Get source properties
SourceVolume = ALSource->flGain;
+ MinVolume = ALSource->flMinGain;
+ MaxVolume = ALSource->flMaxGain;
memcpy(Position, ALSource->vPosition, sizeof(ALSource->vPosition));
memcpy(Direction, ALSource->vOrientation, sizeof(ALSource->vOrientation));
memcpy(Velocity, ALSource->vVelocity, sizeof(ALSource->vVelocity));
- MinVolume = ALSource->flMinGain;
- MaxVolume = ALSource->flMaxGain;
- MinDist = ALSource->flRefDistance;
- MaxDist = ALSource->flMaxDistance;
- Rolloff = ALSource->flRollOffFactor;
- InnerAngle = ALSource->flInnerAngle * ConeScale;
- OuterAngle = ALSource->flOuterAngle * ConeScale;
- WetGainAuto = ALSource->WetGainAuto;
+ InnerAngle = ALSource->flInnerAngle * ConeScale;
+ OuterAngle = ALSource->flOuterAngle * ConeScale;
+ WetGainAuto = ALSource->WetGainAuto;
WetGainHFAuto = ALSource->WetGainHFAuto;
AirAbsorptionFactor = ALSource->AirAbsorptionFactor;
+ Rolloff = ALSource->RoomRolloffFactor;
for(i = 0;i < NumSends;i++)
{
- RoomRolloff[i] = ALSource->RoomRolloffFactor;
+ RoomRolloff[i] = Rolloff;
if(ALSource->Send[i].Slot &&
(ALSource->Send[i].Slot->effect.type == AL_EFFECT_REVERB ||
ALSource->Send[i].Slot->effect.type == AL_EFFECT_EAXREVERB))
RoomRolloff[i] += ALSource->Send[i].Slot->effect.Params.Reverb.RoomRolloffFactor;
}
+ MinDist = ALSource->flRefDistance;
+ MaxDist = ALSource->flMaxDistance;
+ Rolloff = ALSource->flRollOffFactor;
//1. Translate Listener to origin (convert to head relative)
if(ALSource->bHeadRelative == AL_FALSE)