aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-07-13 01:39:44 -0700
committerChris Robinson <[email protected]>2016-07-13 01:39:44 -0700
commit5106f035df7153efa411feb090ba22b1d756998b (patch)
tree0c6f3249b670564894525a1120a702c90dae89c4 /Alc/mixer.c
parente8202b915d63703e6f6dd00a085cefb24ad7b315 (diff)
Move the input channel array out of the DirectParams and SendParams
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index 748a2357..1d14f890 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -553,18 +553,17 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
Device->ResampledData, DstBufferSize
);
{
- DirectParams *parms = &voice->Direct;
+ DirectParams *parms = &voice->Chan[chan].Direct;
const ALfloat *samples;
samples = DoFilters(
- &parms->Filters[chan].LowPass, &parms->Filters[chan].HighPass,
- Device->FilteredData, ResampledData, DstBufferSize,
- parms->Filters[chan].ActiveType
+ &parms->LowPass, &parms->HighPass, Device->FilteredData,
+ ResampledData, DstBufferSize, parms->FilterType
);
if(!voice->IsHrtf)
{
- ALfloat *restrict currents = parms->Gains[chan].Current;
- const ALfloat *targets = parms->Gains[chan].Target;
+ ALfloat *restrict currents = parms->Gains.Current;
+ const ALfloat *targets = parms->Gains.Target;
MixGains gains[MAX_OUTPUT_CHANNELS];
if(!Counter)
@@ -607,7 +606,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
if(!Counter)
{
- parms->Hrtf[chan].Current = parms->Hrtf[chan].Target;
+ parms->Hrtf.Current = parms->Hrtf.Target;
for(j = 0;j < HRIR_LENGTH;j++)
{
hrtfparams.Steps.Coeffs[j][0] = 0.0f;
@@ -622,18 +621,18 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
ALint delaydiff;
for(j = 0;j < IrSize;j++)
{
- coeffdiff = parms->Hrtf[chan].Target.Coeffs[j][0] - parms->Hrtf[chan].Current.Coeffs[j][0];
+ coeffdiff = parms->Hrtf.Target.Coeffs[j][0] - parms->Hrtf.Current.Coeffs[j][0];
hrtfparams.Steps.Coeffs[j][0] = coeffdiff * Delta;
- coeffdiff = parms->Hrtf[chan].Target.Coeffs[j][1] - parms->Hrtf[chan].Current.Coeffs[j][1];
+ coeffdiff = parms->Hrtf.Target.Coeffs[j][1] - parms->Hrtf.Current.Coeffs[j][1];
hrtfparams.Steps.Coeffs[j][1] = coeffdiff * Delta;
}
- delaydiff = (ALint)(parms->Hrtf[chan].Target.Delay[0] - parms->Hrtf[chan].Current.Delay[0]);
+ delaydiff = (ALint)(parms->Hrtf.Target.Delay[0] - parms->Hrtf.Current.Delay[0]);
hrtfparams.Steps.Delay[0] = fastf2i((ALfloat)delaydiff * Delta);
- delaydiff = (ALint)(parms->Hrtf[chan].Target.Delay[1] - parms->Hrtf[chan].Current.Delay[1]);
+ delaydiff = (ALint)(parms->Hrtf.Target.Delay[1] - parms->Hrtf.Current.Delay[1]);
hrtfparams.Steps.Delay[1] = fastf2i((ALfloat)delaydiff * Delta);
}
- hrtfparams.Target = &parms->Hrtf[chan].Target;
- hrtfparams.Current = &parms->Hrtf[chan].Current;
+ hrtfparams.Target = &parms->Hrtf.Target;
+ hrtfparams.Current = &parms->Hrtf.Current;
lidx = GetChannelIdxByName(Device->RealOut, FrontLeft);
ridx = GetChannelIdxByName(Device->RealOut, FrontRight);
@@ -641,15 +640,15 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
MixHrtfSamples(voice->DirectOut.Buffer, lidx, ridx, samples, Counter,
voice->Offset, OutPos, IrSize, &hrtfparams,
- &parms->Hrtf[chan].State, DstBufferSize);
+ &parms->Hrtf.State, DstBufferSize);
}
}
for(j = 0;j < Device->NumAuxSends;j++)
{
- SendParams *parms = &voice->Send[j];
- ALfloat *restrict currents = parms->Gains[chan].Current;
- const ALfloat *targets = parms->Gains[chan].Target;
+ SendParams *parms = &voice->Chan[chan].Send[j];
+ ALfloat *restrict currents = parms->Gains.Current;
+ const ALfloat *targets = parms->Gains.Target;
MixGains gains[MAX_OUTPUT_CHANNELS];
const ALfloat *samples;
@@ -657,9 +656,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam
continue;
samples = DoFilters(
- &parms->Filters[chan].LowPass, &parms->Filters[chan].HighPass,
- Device->FilteredData, ResampledData, DstBufferSize,
- parms->Filters[chan].ActiveType
+ &parms->LowPass, &parms->HighPass, Device->FilteredData,
+ ResampledData, DstBufferSize, parms->FilterType
);
if(!Counter)