aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-11 05:59:20 -0700
committerChris Robinson <[email protected]>2020-08-11 05:59:20 -0700
commit475ed0f039dfc96b235db51d5edb0b7cca6eb4b1 (patch)
tree32777613eadd4e309bdd6986469b39c80efd8cbb /alc
parentc549797af0420942ab460cc3ca1ded1b55956681 (diff)
Use a FlexArray instead of a vector for distance compensation
Diffstat (limited to 'alc')
-rw-r--r--alc/alcmain.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/alc/alcmain.h b/alc/alcmain.h
index a5dc655b..9e6dd35c 100644
--- a/alc/alcmain.h
+++ b/alc/alcmain.h
@@ -130,11 +130,13 @@ public:
};
private:
+ using FloatArray = al::FlexArray<float,16>;
std::array<DistData,MAX_OUTPUT_CHANNELS> mChannels;
- al::vector<float,16> mSamples;
+ std::unique_ptr<FloatArray> mSamples;
public:
- void setSampleCount(size_t new_size) { mSamples.resize(new_size); }
+ void setSampleCount(size_t new_size)
+ { mSamples = FloatArray::Create(new_size); }
void clear() noexcept
{
for(auto &chan : mChannels)
@@ -143,11 +145,10 @@ public:
chan.Length = 0;
chan.Buffer = nullptr;
}
- using SampleVecT = decltype(mSamples);
- SampleVecT{}.swap(mSamples);
+ mSamples = nullptr;
}
- float *getSamples() noexcept { return mSamples.data(); }
+ float *getSamples() noexcept { return mSamples->data(); }
al::span<DistData,MAX_OUTPUT_CHANNELS> as_span() { return mChannels; }
};