diff options
author | Chris Robinson <[email protected]> | 2020-08-28 00:09:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-08-28 00:09:46 -0700 |
commit | 1f486f820e97fd5ce1da40a87aa3b743800fb5b0 (patch) | |
tree | 04e70d2410fcaad3167899b81b2661b57c0488fe /al/buffer.h | |
parent | ecf30de36f6487c1f8a19ae0d03ba810078706f4 (diff) |
Use a separate structure for buffer storage
Diffstat (limited to 'al/buffer.h')
-rw-r--r-- | al/buffer.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/al/buffer.h b/al/buffer.h index 6b1d45f5..bdc87e07 100644 --- a/al/buffer.h +++ b/al/buffer.h @@ -39,27 +39,14 @@ enum UserFmtChannels : unsigned char { struct ALbuffer { - al::vector<al::byte,16> mData; + BufferStorage mBuffer; - ALuint Frequency{0u}; ALbitfieldSOFT Access{0u}; - ALuint SampleLen{0u}; - - FmtChannels mFmtChannels{}; - FmtType mFmtType{}; UserFmtType OriginalType{}; ALuint OriginalSize{0}; ALuint OriginalAlign{0}; - ALenum AmbiLayout{AL_FUMA_SOFT}; - ALenum AmbiScaling{AL_FUMA_SOFT}; - /* AmbiOrder is only updated when loading new data. */ - ALuint AmbiOrder{0}; - - LPALBUFFERCALLBACKTYPESOFT Callback{nullptr}; - void *UserData{nullptr}; - ALuint LoopStart{0u}; ALuint LoopEnd{0u}; @@ -77,10 +64,9 @@ struct ALbuffer { /* Self ID */ ALuint id{0}; - inline ALuint bytesFromFmt() const noexcept { return BytesFromFmt(mFmtType); } - inline ALuint channelsFromFmt() const noexcept - { return ChannelsFromFmt(mFmtChannels, AmbiOrder); } - inline ALuint frameSizeFromFmt() const noexcept { return channelsFromFmt() * bytesFromFmt(); } + inline ALuint bytesFromFmt() const noexcept { return mBuffer.bytesFromFmt(); } + inline ALuint channelsFromFmt() const noexcept { return mBuffer.channelsFromFmt(); } + inline ALuint frameSizeFromFmt() const noexcept { return mBuffer.frameSizeFromFmt(); } DISABLE_ALLOC() }; |