From 6ee54fb1f3e050c6f49e5fef379c9b9f80e4683d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 19 Mar 2014 13:14:11 -0700 Subject: Store some source mixing parameters in the active source struct --- Alc/mixer.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Alc/mixer.c') diff --git a/Alc/mixer.c b/Alc/mixer.c index acd6c610..36a08ccd 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -94,8 +94,9 @@ static void DoFilter(ALfilterState *filter, ALfloat *restrict dst, const ALfloat } -ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) +ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo) { + ALsource *Source = src->Source; ALbufferlistitem *BufferListItem; ALuint DataPosInt, DataPosFrac; ALuint BuffersPlayed; @@ -115,7 +116,7 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) DataPosInt = Source->position; DataPosFrac = Source->position_fraction; Looping = Source->Looping; - increment = Source->Params.Step; + increment = src->Step; Resampler = (increment==FRACTIONONE) ? PointResampler : Source->Resampler; NumChannels = Source->NumChannels; SampleSize = Source->SampleSize; @@ -322,28 +323,28 @@ ALvoid MixSource(ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) } /* Now resample, then filter and mix to the appropriate outputs. */ - Source->Params.Resample(&SrcData[BufferPrePadding], DataPosFrac, - increment, ResampledData, DstBufferSize); + src->Resample(&SrcData[BufferPrePadding], DataPosFrac, + increment, ResampledData, DstBufferSize); { - DirectParams *directparms = &Source->Params.Direct; + DirectParams *directparms = &src->Direct; DoFilter(&directparms->LpFilter[chan], SrcData, ResampledData, DstBufferSize); - Source->Params.DryMix(directparms, SrcData, chan, OutPos, - SamplesToDo, DstBufferSize); + src->DryMix(directparms, SrcData, chan, OutPos, + SamplesToDo, DstBufferSize); } for(j = 0;j < Device->NumAuxSends;j++) { - SendParams *sendparms = &Source->Params.Send[j]; + SendParams *sendparms = &src->Send[j]; if(!sendparms->OutBuffer) continue; DoFilter(&sendparms->LpFilter[chan], SrcData, ResampledData, DstBufferSize); - Source->Params.WetMix(sendparms, SrcData, OutPos, - SamplesToDo, DstBufferSize); + src->WetMix(sendparms, SrcData, OutPos, + SamplesToDo, DstBufferSize); } } /* Update positions */ -- cgit v1.2.3