191
for(i = 1;i < chans;i++)
191
for(i = 0;i < chans;i++)
193
if(SpeakerAngle[i] <= SpeakerAngle[i-1])
195
AL_PRINT("Speaker %d of %d does not follow previous: %f > %f\n", i, chans,
196
SpeakerAngle[i-1] * 180.0f/M_PI, SpeakerAngle[i] * 180.0f/M_PI);
197
SpeakerAngle[i] = SpeakerAngle[i-1] + 1 * M_PI/180.0f;
196
for(i2 = i+1;i2 < chans;i2++)
198
if(SpeakerAngle[i2] < SpeakerAngle[min])
207
tmpf = SpeakerAngle[i];
208
SpeakerAngle[i] = SpeakerAngle[min];
209
SpeakerAngle[min] = tmpf;
211
tmpi = Speaker2Chan[i];
212
Speaker2Chan[i] = Speaker2Chan[min];
213
Speaker2Chan[min] = tmpi;
723
739
ALeffectslot *Slot = ALSource->Send[i].Slot;
725
if(Slot && Slot->effect.type != AL_EFFECT_NULL)
727
if(Slot->AuxSendAuto)
741
if(!Slot || Slot->effect.type == AL_EFFECT_NULL)
743
ALSource->Params.WetGains[i] = 0.0f;
748
if(Slot->AuxSendAuto)
750
if(ALSource->WetGainAuto)
751
WetGain[i] *= ConeVolume;
752
if(ALSource->WetGainHFAuto)
753
WetGainHF[i] *= ConeHF;
755
// Clamp to Min/Max Gain
756
WetGain[i] = __min(WetGain[i],MaxVolume);
757
WetGain[i] = __max(WetGain[i],MinVolume);
759
if(Slot->effect.type == AL_EFFECT_REVERB ||
760
Slot->effect.type == AL_EFFECT_EAXREVERB)
729
if(ALSource->WetGainAuto)
730
WetGain[i] *= ConeVolume;
731
if(ALSource->WetGainHFAuto)
732
WetGainHF[i] *= ConeHF;
734
// Clamp to Min/Max Gain
735
WetGain[i] = __min(WetGain[i],MaxVolume);
736
WetGain[i] = __max(WetGain[i],MinVolume);
738
if(Slot->effect.type == AL_EFFECT_REVERB ||
739
Slot->effect.type == AL_EFFECT_EAXREVERB)
741
/* Apply a decay-time transformation to the wet path,
742
* based on the attenuation of the dry path.
744
* Using the approximate (effective) source to listener
745
* distance, the initial decay of the reverb effect is
746
* calculated and applied to the wet path.
748
WetGain[i] *= pow(10.0, effectiveDist /
762
/* Apply a decay-time transformation to the wet path, based on
763
* the attenuation of the dry path.
765
* Using the approximate (effective) source to listener
766
* distance, the initial decay of the reverb effect is
767
* calculated and applied to the wet path.
769
WetGain[i] *= aluPow(10.0f, effectiveDist /
749
770
(SPEEDOFSOUNDMETRESPERSEC *
750
771
Slot->effect.Reverb.DecayTime) *
753
WetGainHF[i] *= pow(10.0,
754
log10(Slot->effect.Reverb.AirAbsorptionGainHF) *
755
ALSource->AirAbsorptionFactor * effectiveDist);
760
// If the slot's auxiliary send auto is off, the data sent to
761
// the effect slot is the same as the dry path, sans filter
764
WetGainHF[i] = DryGainHF;
767
switch(ALSource->Send[i].WetFilter.type)
769
case AL_FILTER_LOWPASS:
770
WetGain[i] *= ALSource->Send[i].WetFilter.Gain;
771
WetGainHF[i] *= ALSource->Send[i].WetFilter.GainHF;
774
ALSource->Params.WetGains[i] = WetGain[i] * ListenerGain;
774
WetGainHF[i] *= aluPow(10.0f,
775
log10(Slot->effect.Reverb.AirAbsorptionGainHF) *
776
ALSource->AirAbsorptionFactor * effectiveDist);
778
ALSource->Params.WetGains[i] = 0.0f;
781
/* If the slot's auxiliary send auto is off, the data sent to the
782
* effect slot is the same as the dry path, sans filter effects */
784
WetGainHF[i] = DryGainHF;
787
switch(ALSource->Send[i].WetFilter.type)
789
case AL_FILTER_LOWPASS:
790
WetGain[i] *= ALSource->Send[i].WetFilter.Gain;
791
WetGainHF[i] *= ALSource->Send[i].WetFilter.GainHF;
794
ALSource->Params.WetGains[i] = WetGain[i] * ListenerGain;
782
796
for(i = NumSends;i < MAX_SENDS;i++)