aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-02 23:41:26 -0800
committerChris Robinson <[email protected]>2019-03-02 23:41:26 -0800
commit2d14de3fb03f891ea38c26c1a203c186db3e58e2 (patch)
treef06773599ff1f29f2936fc4c2794f84bd97e3812 /Alc
parent0aa0f24dd749fecadade906ce58f56b6726c0f20 (diff)
Use more specific names for temp buffer storage
Diffstat (limited to 'Alc')
-rw-r--r--Alc/mixvoice.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index 9ba5079e..2cc26d7b 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -283,10 +283,6 @@ const ALfloat *DoFilters(BiquadFilter *lpfilter, BiquadFilter *hpfilter,
} // namespace
-/* This function uses these device temp buffers. */
-#define RESAMPLED_BUF 0
-#define FILTERED_BUF 1
-#define NFC_DATA_BUF 2
ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context, const ALsizei SamplesToDo)
{
ASSUME(SamplesToDo > 0);
@@ -544,8 +540,7 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
/* Resample, then apply ambisonic upsampling as needed. */
const ALfloat *ResampledData{Resample(&voice->ResampleState,
&SrcData[MAX_RESAMPLE_PADDING], DataPosFrac, increment,
- Device->TempBuffer[RESAMPLED_BUF], DstBufferSize
- )};
+ Device->ResampledData, DstBufferSize)};
if((voice->Flags&VOICE_IS_AMBISONIC))
{
/* TODO: Does not properly handle HOA sources. Currently only
@@ -553,8 +548,8 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
* be desirable.
*/
const ALfloat hfscale{(chan==0) ? voice->AmbiScales[0] : voice->AmbiScales[1]};
- ALfloat (&hfbuf)[BUFFERSIZE] = Device->TempBuffer[FILTERED_BUF];
- ALfloat (&lfbuf)[BUFFERSIZE] = Device->TempBuffer[RESAMPLED_BUF];
+ ALfloat (&hfbuf)[BUFFERSIZE] = Device->FilteredData;
+ ALfloat (&lfbuf)[BUFFERSIZE] = Device->ResampledData;
voice->AmbiSplitter[chan].process(hfbuf, lfbuf, ResampledData, DstBufferSize);
MixRowSamples(lfbuf, &hfscale, &hfbuf, 1, 0, DstBufferSize);
@@ -566,9 +561,7 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
{
DirectParams &parms = voice->Direct.Params[chan];
const ALfloat *samples{DoFilters(&parms.LowPass, &parms.HighPass,
- Device->TempBuffer[FILTERED_BUF], ResampledData, DstBufferSize,
- voice->Direct.FilterType
- )};
+ Device->FilteredData, ResampledData, DstBufferSize, voice->Direct.FilterType)};
if(!(voice->Flags&VOICE_HAS_HRTF))
{
@@ -578,15 +571,14 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
DstBufferSize);
else
{
- MixSamples(samples,
- voice->Direct.ChannelsPerOrder[0], voice->Direct.Buffer,
- parms.Gains.Current, parms.Gains.Target, Counter, OutPos,
- DstBufferSize);
+ MixSamples(samples, voice->Direct.ChannelsPerOrder[0],
+ voice->Direct.Buffer, parms.Gains.Current, parms.Gains.Target, Counter,
+ OutPos, DstBufferSize);
- ALfloat *nfcsamples{Device->TempBuffer[NFC_DATA_BUF]};
+ ALfloat (&nfcsamples)[BUFFERSIZE] = Device->NfcSampleData;
ALsizei chanoffset{voice->Direct.ChannelsPerOrder[0]};
using FilterProc = void (NfcFilter::*)(float*,const float*,int);
- auto apply_nfc = [voice,&parms,samples,DstBufferSize,Counter,OutPos,&chanoffset,nfcsamples](FilterProc process, ALsizei order) -> void
+ auto apply_nfc = [voice,&parms,samples,DstBufferSize,Counter,OutPos,&chanoffset,&nfcsamples](FilterProc process, ALsizei order) -> void
{
if(voice->Direct.ChannelsPerOrder[order] < 1)
return;
@@ -669,7 +661,7 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
}
}
- ALfloat (&FilterBuf)[BUFFERSIZE] = Device->TempBuffer[FILTERED_BUF];
+ ALfloat (&FilterBuf)[BUFFERSIZE] = Device->FilteredData;
auto mix_send = [Counter,OutPos,DstBufferSize,chan,ResampledData,&FilterBuf](ALvoice::SendData &send) -> void
{
if(!send.Buffer)