diff options
author | Chris Robinson <[email protected]> | 2019-06-08 01:39:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-08 01:39:28 -0700 |
commit | 91b7e8142caf297b97d6b403ee79ba2dcbcda09f (patch) | |
tree | 5b6d15b3d37af929436a00fa772d4102fb719e73 /OpenAL32/Include | |
parent | 7988bc6e91899179a71650bd2534d7749f2a68c3 (diff) |
Simplify DistanceComp somewhat
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alMain.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index e0639825..962b8e15 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -28,6 +28,7 @@ #include "vector.h" #include "almalloc.h" #include "alnumeric.h" +#include "alspan.h" #include "threads.h" #include "ambidefs.h" #include "hrtf.h" @@ -266,8 +267,7 @@ private: al::vector<ALfloat,16> mSamples; public: - void resize(size_t new_size) { mSamples.resize(new_size); } - void shrink_to_fit() { mSamples.shrink_to_fit(); } + void setSampleCount(size_t new_size) { mSamples.resize(new_size); } void clear() noexcept { for(auto &chan : mChannel) @@ -276,21 +276,13 @@ public: chan.Length = 0; chan.Buffer = nullptr; } - mSamples.clear(); + using SampleVecT = decltype(mSamples); + SampleVecT{}.swap(mSamples); } - DistData *begin() noexcept { return std::begin(mChannel); } - const DistData *begin() const noexcept { return std::begin(mChannel); } - const DistData *cbegin() const noexcept { return std::begin(mChannel); } - DistData *end() noexcept { return std::end(mChannel); } - const DistData *end() const noexcept { return std::end(mChannel); } - const DistData *cend() const noexcept { return std::end(mChannel); } + ALfloat *getSamples() noexcept { return mSamples.data(); } - ALfloat *data() noexcept { return mSamples.data(); } - const ALfloat *data() const noexcept { return mSamples.data(); } - - DistData& operator[](size_t o) noexcept { return mChannel[o]; } - const DistData& operator[](size_t o) const noexcept { return mChannel[o]; } + al::span<DistData,MAX_OUTPUT_CHANNELS> as_span() { return mChannel; } }; struct BFChannelConfig { |