diff options
author | Chris Robinson <[email protected]> | 2019-01-12 01:25:33 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-01-12 01:25:33 -0800 |
commit | d64eaba3229f48a519586c0436235e3c2809329b (patch) | |
tree | d578ef76627df78c0ec7b1ef2bca1fd1e8af0db1 /Alc/hrtf.h | |
parent | ab1667146627e93688cfeb4cf877764f220c0c3e (diff) |
Use a flexible array for DirectHrtfState and ALvoice
Diffstat (limited to 'Alc/hrtf.h')
-rw-r--r-- | Alc/hrtf.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -59,13 +59,19 @@ struct DirectHrtfState { /* HRTF filter state for dry buffer content */ ALsizei Offset{0}; ALsizei IrSize{0}; - struct { + struct ChanData { alignas(16) ALfloat Values[HRIR_LENGTH][2]; alignas(16) ALfloat Coeffs[HRIR_LENGTH][2]; - } Chan[]; + }; + al::FlexArray<ChanData> Chan; - DirectHrtfState() noexcept { } - static std::unique_ptr<DirectHrtfState> Create(ALsizei num_chans); + DirectHrtfState(size_t numchans) : Chan{numchans} { } + DirectHrtfState(const DirectHrtfState&) = delete; + DirectHrtfState& operator=(const DirectHrtfState&) = delete; + + static std::unique_ptr<DirectHrtfState> Create(size_t num_chans); + static constexpr size_t Sizeof(size_t numchans) noexcept + { return al::FlexArray<ChanData>::Sizeof(numchans, offsetof(DirectHrtfState, Chan)); } DEF_PLACE_NEWDEL() }; |