Move the target effect slot to the SendParams struct

This commit is contained in:
Chris Robinson 2012-09-08 22:32:30 -07:00
parent 89cab3cd39
commit 2bf1979d4a
6 changed files with 13 additions and 15 deletions

View File

@ -303,7 +303,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
Slot = Device->DefaultSlot;
if(Slot && Slot->effect.type == AL_EFFECT_NULL)
Slot = NULL;
ALSource->Params.Slot[i] = Slot;
ALSource->Params.Send[i].Slot = Slot;
ALSource->Params.Send[i].Gain = WetGain[i];
}
@ -440,7 +440,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
RoomAirAbsorption[i] = AIRABSORBGAINHF;
}
ALSource->Params.Slot[i] = Slot;
ALSource->Params.Send[i].Slot = Slot;
}
/* Transform source to listener space (convert to head relative) */

View File

@ -437,11 +437,10 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
BufferSize);
for(j = 0;j < Device->NumAuxSends;j++)
{
if(!Source->Params.Slot[j])
if(!Source->Params.Send[j].Slot)
continue;
Source->Params.WetMix(Source, j, &Source->Params.Send[j],
ResampledData, i, OutPos, SamplesToDo,
BufferSize);
Source->Params.WetMix(&Source->Params.Send[j], ResampledData, i,
OutPos, SamplesToDo, BufferSize);
}
}
for(i = 0;i < BufferSize;i++)

View File

@ -13,16 +13,16 @@ struct SendParams;
/* C mixers */
void MixDirect_Hrtf_C(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixDirect_C(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_C(struct ALsource*,ALuint,struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_C(struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
/* SSE mixers */
void MixDirect_Hrtf_SSE(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixDirect_SSE(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_SSE(struct ALsource*,ALuint,struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_SSE(struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
/* Neon mixers */
void MixDirect_Hrtf_Neon(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixDirect_Neon(struct ALsource*,ALCdevice*,struct DirectParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_Neon(struct ALsource*,ALuint,struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
void MixSend_Neon(struct SendParams*,const ALfloat*RESTRICT,ALuint,ALuint,ALuint,ALuint);
#endif /* MIXER_DEFS_H */

View File

@ -192,8 +192,7 @@ void MixDirect(ALsource *Source, ALCdevice *Device, DirectParams *params,
}
void MixSend(ALsource *Source, ALuint sendidx, SendParams *params,
const ALfloat *RESTRICT data, ALuint srcchan,
void MixSend(SendParams *params, const ALfloat *RESTRICT data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
{
ALeffectslot *Slot;
@ -205,7 +204,7 @@ void MixSend(ALsource *Source, ALuint sendidx, SendParams *params,
ALuint pos;
ALfloat value;
Slot = Source->Params.Slot[sendidx];
Slot = params->Slot;
WetBuffer = Slot->WetBuffer;
WetClickRemoval = Slot->ClickRemoval;
WetPendingClicks = Slot->PendingClicks;

View File

@ -59,6 +59,8 @@ typedef struct DirectParams {
} DirectParams;
typedef struct SendParams {
struct ALeffectslot *Slot;
/* Gain control, which applies to all input channels to a single (mono)
* output buffer. */
ALfloat Gain;
@ -154,7 +156,6 @@ typedef struct ALsource
DirectParams Direct;
struct ALeffectslot *Slot[MAX_SENDS];
SendParams Send[MAX_SENDS];
} Params;
/** Source needs to update its mixing parameters. */

View File

@ -113,8 +113,7 @@ typedef ALvoid (*DryMixerFunc)(struct ALsource *self, ALCdevice *Device,
const ALfloat *RESTRICT data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo,
ALuint BufferSize);
typedef ALvoid (*WetMixerFunc)(struct ALsource *self, ALuint sendidx,
struct SendParams *params,
typedef ALvoid (*WetMixerFunc)(struct SendParams *params,
const ALfloat *RESTRICT data, ALuint srcchan,
ALuint OutPos, ALuint SamplesToDo,
ALuint BufferSize);