diff options
author | Chris Robinson <[email protected]> | 2018-11-25 15:30:32 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-25 15:30:32 -0800 |
commit | 8ae07ad1ae2d957f65ba54fdcd19649eceeb0e3d (patch) | |
tree | b26085490d71fdb2e0968bfd79c90c3dd3613764 /OpenAL32/Include/alMain.h | |
parent | 05845b53e889c2104a5436ff5418c5e2ba5dcbf3 (diff) |
Automatically clean up buffers with ther sublist
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 5ff1e064..eae3ea99 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -551,10 +551,20 @@ typedef union AmbiConfig { } AmbiConfig; -typedef struct BufferSubList { - ALuint64 FreeMask{~ALuint64{}}; +struct BufferSubList { + uint64_t FreeMask{~uint64_t{}}; struct ALbuffer *Buffers{nullptr}; /* 64 */ -} BufferSubList; + + BufferSubList() noexcept = default; + BufferSubList(const BufferSubList&) = delete; + BufferSubList(BufferSubList&& rhs) noexcept : FreeMask{rhs.FreeMask}, Buffers{rhs.Buffers} + { rhs.FreeMask = ~uint64_t{}; rhs.Buffers = nullptr; } + ~BufferSubList(); + + BufferSubList& operator=(const BufferSubList&) = delete; + BufferSubList& operator=(BufferSubList&& rhs) noexcept + { std::swap(FreeMask, rhs.FreeMask); std::swap(Buffers, rhs.Buffers); return *this; } +}; typedef struct EffectSubList { ALuint64 FreeMask{~ALuint64{}}; |