diff options
author | Chris Robinson <[email protected]> | 2019-09-14 18:27:57 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-14 18:35:23 -0700 |
commit | 807d3b64cac2793ce678acb3fc4d4191b2252875 (patch) | |
tree | b766e0838c75fcf069015078259c5bfbd56bce63 /alc/mixvoice.cpp | |
parent | 2cc0600476fc4ed13a64eeb59c02c213bd3b6dd4 (diff) |
Enable and fix more warnings
Diffstat (limited to 'alc/mixvoice.cpp')
-rw-r--r-- | alc/mixvoice.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/alc/mixvoice.cpp b/alc/mixvoice.cpp index d7a32f35..2b5972f3 100644 --- a/alc/mixvoice.cpp +++ b/alc/mixvoice.cpp @@ -405,24 +405,24 @@ ALfloat *LoadBufferStatic(ALbufferlistitem *BufferListItem, ALbufferlistitem *&B BufferLoopItem = nullptr; /* Load what's left to play from the buffer */ - const size_t DataSize{minz(SrcBuffer.size(), Buffer->SampleLen-DataPosInt)}; + const size_t DataRem{minz(SrcBuffer.size(), Buffer->SampleLen-DataPosInt)}; const al::byte *Data{Buffer->mData.data()}; Data += (DataPosInt*NumChannels + chan)*SampleSize; - LoadSamples(SrcBuffer.data(), Data, NumChannels, Buffer->mFmtType, DataSize); - SrcBuffer = SrcBuffer.subspan(DataSize); + LoadSamples(SrcBuffer.data(), Data, NumChannels, Buffer->mFmtType, DataRem); + SrcBuffer = SrcBuffer.subspan(DataRem); } else { /* Load what's left of this loop iteration */ - const size_t DataSize{minz(SrcBuffer.size(), LoopEnd-DataPosInt)}; + const size_t DataRem{minz(SrcBuffer.size(), LoopEnd-DataPosInt)}; const al::byte *Data{Buffer->mData.data()}; Data += (DataPosInt*NumChannels + chan)*SampleSize; - LoadSamples(SrcBuffer.data(), Data, NumChannels, Buffer->mFmtType, DataSize); - SrcBuffer = SrcBuffer.subspan(DataSize); + LoadSamples(SrcBuffer.data(), Data, NumChannels, Buffer->mFmtType, DataRem); + SrcBuffer = SrcBuffer.subspan(DataRem); /* Load any repeats of the loop we can to fill the buffer. */ const auto LoopSize = static_cast<size_t>(LoopEnd - LoopStart); @@ -430,8 +430,7 @@ ALfloat *LoadBufferStatic(ALbufferlistitem *BufferListItem, ALbufferlistitem *&B { const size_t DataSize{minz(SrcBuffer.size(), LoopSize)}; - const al::byte *Data{Buffer->mData.data()}; - Data += (LoopStart*NumChannels + chan)*SampleSize; + Data = Buffer->mData.data() + (LoopStart*NumChannels + chan)*SampleSize; LoadSamples(SrcBuffer.data(), Data, NumChannels, Buffer->mFmtType, DataSize); SrcBuffer = SrcBuffer.subspan(DataSize); @@ -510,12 +509,14 @@ void ALvoice::mix(State vstate, ALCcontext *Context, const ALuint SamplesToDo) for(ALuint chan{0};chan < NumChannels;chan++) { ChannelData &chandata = mChans[chan]; - DirectParams &parms = chandata.mDryParams; - if(!(mFlags&VOICE_HAS_HRTF)) - std::copy(std::begin(parms.Gains.Target), std::end(parms.Gains.Target), - std::begin(parms.Gains.Current)); - else - parms.Hrtf.Old = parms.Hrtf.Target; + { + DirectParams &parms = chandata.mDryParams; + if(!(mFlags&VOICE_HAS_HRTF)) + std::copy(std::begin(parms.Gains.Target), std::end(parms.Gains.Target), + std::begin(parms.Gains.Current)); + else + parms.Hrtf.Old = parms.Hrtf.Target; + } for(ALuint send{0};send < NumSends;++send) { if(mSend[send].Buffer.empty()) |