aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-06 14:27:33 -0700
committerChris Robinson <[email protected]>2010-11-06 14:27:33 -0700
commit07346da740302fa0db8f756652e992f18f689f56 (patch)
tree309c2dc8a7758d9e0f17b62561abb6efc9080b7a
parentc95f182a90a1b31188e3ab7e765e28e94212cfe6 (diff)
Use the number of sends the device is configured for in more places
-rw-r--r--Alc/ALu.c10
-rw-r--r--Alc/mixer.c6
-rw-r--r--OpenAL32/alAuxEffectSlot.c6
3 files changed, 7 insertions, 15 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index ce1645fe..34a59b77 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -232,11 +232,6 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.WetGains[i] = WetGain[i] * ListenerGain;
}
- for(i = NumSends;i < MAX_SENDS;i++)
- {
- ALSource->Params.WetGains[i] = 0.0f;
- WetGainHF[i] = 1.0f;
- }
/* Update filter coefficients. Calculations based on the I3DL2
* spec. */
@@ -551,11 +546,6 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
ALSource->Params.WetGains[i] = WetGain[i] * ListenerGain;
}
- for(i = NumSends;i < MAX_SENDS;i++)
- {
- ALSource->Params.WetGains[i] = 0.0f;
- WetGainHF[i] = 1.0f;
- }
// Apply filter gains and filters
switch(ALSource->DirectFilter.type)
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 4c7fff32..6cc92837 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -174,7 +174,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
PendingClicks[BACK_CENTER] += value*DrySend[BACK_CENTER]; \
} \
\
- for(out = 0;out < MAX_SENDS;out++) \
+ for(out = 0;out < Device->NumAuxSends;out++) \
{ \
ALfloat WetSend; \
ALfloat *WetBuffer; \
@@ -315,7 +315,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
} \
} \
\
- for(out = 0;out < MAX_SENDS;out++) \
+ for(out = 0;out < Device->NumAuxSends;out++) \
{ \
ALfloat WetSend; \
ALfloat *WetBuffer; \
@@ -460,7 +460,7 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
} \
} \
\
- for(out = 0;out < MAX_SENDS;out++) \
+ for(out = 0;out < Device->NumAuxSends;out++) \
{ \
ALfloat WetSend; \
ALfloat *WetBuffer; \
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 5d86409f..520b8ea7 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -173,6 +173,7 @@ AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot)
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue)
{
+ ALCdevice *Device;
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
ALeffectslot *EffectSlot;
@@ -180,6 +181,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
Context = GetContextSuspended();
if(!Context) return;
+ Device = Context->Device;
if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslot)) != NULL)
{
switch(param)
@@ -188,7 +190,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
ALeffect *effect = NULL;
if(iValue == 0 ||
- (effect=LookupEffect(Context->Device->EffectMap, iValue)) != NULL)
+ (effect=LookupEffect(Device->EffectMap, iValue)) != NULL)
{
InitializeEffect(Context, EffectSlot, effect);
updateSources = AL_TRUE;
@@ -224,7 +226,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
{
ALsource *source = Context->SourceMap.array[pos].value;
ALuint i;
- for(i = 0;i < MAX_SENDS;i++)
+ for(i = 0;i < Device->NumAuxSends;i++)
{
if(!source->Send[i].Slot ||
source->Send[i].Slot->effectslot != effectslot)