Move the direct and send params into separate different types
This commit is contained in:
@@ -320,7 +320,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
|
||||
Slot = Device->DefaultSlot;
|
||||
if(Slot && Slot->effect.type == AL_EFFECT_NULL)
|
||||
Slot = NULL;
|
||||
ALSource->Params.Send[i].Slot = Slot;
|
||||
ALSource->Params.Slot[i] = Slot;
|
||||
ALSource->Params.Send[i].Gain = WetGain[i] * ListenerGain;
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
|
||||
RoomAirAbsorption[i] = AIRABSORBGAINHF;
|
||||
}
|
||||
|
||||
ALSource->Params.Send[i].Slot = Slot;
|
||||
ALSource->Params.Slot[i] = Slot;
|
||||
}
|
||||
|
||||
/* Transform source to listener space (convert to head relative) */
|
||||
|
||||
+2
-2
@@ -336,7 +336,7 @@ static void MixSend_##sampler(ALsource *Source, ALuint sendidx, \
|
||||
\
|
||||
increment = Source->Params.Step; \
|
||||
\
|
||||
Slot = Source->Params.Send[sendidx].Slot; \
|
||||
Slot = Source->Params.Slot[sendidx]; \
|
||||
WetBuffer = Slot->WetBuffer; \
|
||||
WetClickRemoval = Slot->ClickRemoval; \
|
||||
WetPendingClicks = Slot->PendingClicks; \
|
||||
@@ -719,7 +719,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo)
|
||||
OutPos, SamplesToDo, BufferSize);
|
||||
for(i = 0;i < Device->NumAuxSends;i++)
|
||||
{
|
||||
if(!Source->Params.Send[i].Slot)
|
||||
if(!Source->Params.Slot[i])
|
||||
continue;
|
||||
Source->Params.WetMix(Source, i, SrcData, DataPosFrac,
|
||||
OutPos, SamplesToDo, BufferSize);
|
||||
|
||||
+32
-22
@@ -28,6 +28,14 @@ typedef struct ALbufferlistitem
|
||||
struct ALbufferlistitem *prev;
|
||||
} ALbufferlistitem;
|
||||
|
||||
typedef struct HrtfState {
|
||||
ALboolean Moving;
|
||||
ALuint Counter;
|
||||
ALfloat History[MAXCHANNELS][SRC_HISTORY_LENGTH];
|
||||
ALfloat Values[MAXCHANNELS][HRIR_LENGTH][2];
|
||||
ALuint Offset;
|
||||
} HrtfState;
|
||||
|
||||
typedef struct HrtfParams {
|
||||
ALfloat Gain;
|
||||
ALfloat Dir[3];
|
||||
@@ -37,13 +45,27 @@ typedef struct HrtfParams {
|
||||
ALint DelayStep[2];
|
||||
} HrtfParams;
|
||||
|
||||
typedef struct HrtfState {
|
||||
ALboolean Moving;
|
||||
ALuint Counter;
|
||||
ALfloat History[MAXCHANNELS][SRC_HISTORY_LENGTH];
|
||||
ALfloat Values[MAXCHANNELS][HRIR_LENGTH][2];
|
||||
ALuint Offset;
|
||||
} HrtfState;
|
||||
typedef struct DirectParams {
|
||||
/* A mixing matrix. First subscript is the channel number of the input data
|
||||
* (regardless of channel configuration) and the second is the channel
|
||||
* target (eg. FRONT_LEFT). */
|
||||
ALfloat Gains[MAXCHANNELS][MAXCHANNELS];
|
||||
|
||||
/* A low-pass filter, using 2 chained one-pole filters. */
|
||||
FILTER iirFilter;
|
||||
ALfloat history[MAXCHANNELS*2];
|
||||
} DirectParams;
|
||||
|
||||
typedef struct SendParams {
|
||||
/* Gain control, which applies to all input channels to a single (mono)
|
||||
* output buffer. */
|
||||
ALfloat Gain;
|
||||
|
||||
/* A low-pass filter, using a one-pole filter. */
|
||||
FILTER iirFilter;
|
||||
ALfloat history[MAXCHANNELS];
|
||||
} SendParams;
|
||||
|
||||
|
||||
typedef struct ALsource
|
||||
{
|
||||
@@ -130,22 +152,10 @@ typedef struct ALsource
|
||||
|
||||
HrtfParams Hrtf;
|
||||
|
||||
struct {
|
||||
/* A mixing matrix. First subscript is the channel number of the
|
||||
* input data (regardless of channel configuration) and the second
|
||||
* is the channel target (eg. FRONT_LEFT). */
|
||||
ALfloat Gains[MAXCHANNELS][MAXCHANNELS];
|
||||
DirectParams Direct;
|
||||
|
||||
FILTER iirFilter;
|
||||
ALfloat history[MAXCHANNELS*2];
|
||||
} Direct;
|
||||
|
||||
struct {
|
||||
struct ALeffectslot *Slot;
|
||||
ALfloat Gain;
|
||||
FILTER iirFilter;
|
||||
ALfloat history[MAXCHANNELS];
|
||||
} Send[MAX_SENDS];
|
||||
struct ALeffectslot *Slot[MAX_SENDS];
|
||||
SendParams Send[MAX_SENDS];
|
||||
} Params;
|
||||
/** Source needs to update its mixing parameters. */
|
||||
volatile ALenum NeedsUpdate;
|
||||
|
||||
Reference in New Issue
Block a user