diff options
author | Chris Robinson <[email protected]> | 2018-12-10 14:49:57 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-10 14:49:57 -0800 |
commit | ed18fd76c5546b295731fc5bbd9adcca896106e2 (patch) | |
tree | 31ca8194cd6afac2632f452ff32175962425f176 /OpenAL32/Include/alMain.h | |
parent | d91ada2e028338df35929a79a9393c6ac6e7b168 (diff) |
Clean up a few more loops
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 422202bd..0f65965a 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -608,15 +608,19 @@ typedef struct EnumeratedHrtf { #define MAX_DELAY_LENGTH 1024 class DistanceComp { +public: struct DistData { ALfloat Gain{1.0f}; ALsizei Length{0}; /* Valid range is [0...MAX_DELAY_LENGTH). */ ALfloat *Buffer{nullptr}; - } mChannel[MAX_OUTPUT_CHANNELS]; + }; + +private: + DistData mChannel[MAX_OUTPUT_CHANNELS]; al::vector<ALfloat,16> mSamples; public: - void resize(size_t amt) { mSamples.resize(amt); } + void resize(size_t new_size) { mSamples.resize(new_size); } void shrink_to_fit() { mSamples.shrink_to_fit(); } void clear() noexcept { @@ -629,6 +633,13 @@ public: mSamples.clear(); } + 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 *data() noexcept { return mSamples.data(); } const ALfloat *data() const noexcept { return mSamples.data(); } |