diff options
author | Chris Robinson <[email protected]> | 2019-05-29 21:58:37 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-29 21:58:37 -0700 |
commit | 893ffe9a84d497d38e6e472b0cffbd9c37e0c366 (patch) | |
tree | e86cb9f28857507a54aad958e8c4a9dd361c3e28 /Alc/effects/modulator.cpp | |
parent | 8af7b4c6e0ddaf4d66455702a7ede0c9036f3825 (diff) |
Use span<FloatBufferLine> for MixSamples
Diffstat (limited to 'Alc/effects/modulator.cpp')
-rw-r--r-- | Alc/effects/modulator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp index ec0b6184..9b7abbb7 100644 --- a/Alc/effects/modulator.cpp +++ b/Alc/effects/modulator.cpp @@ -143,10 +143,10 @@ void ModulatorState::update(const ALCcontext *context, const ALeffectslot *slot, void ModulatorState::process(const ALsizei samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, FloatBufferLine *RESTRICT samplesOut, const ALsizei numOutput) { - const ALsizei step = mStep; - ALsizei base; + const ALsizei step{mStep}; - for(base = 0;base < samplesToDo;) + const al::span<FloatBufferLine> output{samplesOut, samplesOut+numOutput}; + for(ALsizei base{0};base < samplesToDo;) { alignas(16) ALfloat modsamples[MAX_UPDATE_SAMPLES]; ALsizei td = mini(MAX_UPDATE_SAMPLES, samplesToDo-base); @@ -165,8 +165,8 @@ void ModulatorState::process(const ALsizei samplesToDo, const FloatBufferLine *R for(i = 0;i < td;i++) temps[i] *= modsamples[i]; - MixSamples(temps, numOutput, &reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(samplesOut[0]), - mChans[c].CurrentGains, mChans[c].TargetGains, samplesToDo-base, base, td); + MixSamples(temps, output, mChans[c].CurrentGains, mChans[c].TargetGains, + samplesToDo-base, base, td); } base += td; |