aboutsummaryrefslogtreecommitdiffstats
path: root/al/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'al/buffer.h')
-rw-r--r--al/buffer.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/al/buffer.h b/al/buffer.h
index ad7aeb35..07012b2d 100644
--- a/al/buffer.h
+++ b/al/buffer.h
@@ -59,10 +59,8 @@ enum FmtChannels : unsigned char {
#define MAX_INPUT_CHANNELS (8)
-ALuint BytesFromFmt(FmtType type);
-ALuint ChannelsFromFmt(FmtChannels chans);
-inline ALuint FrameSizeFromFmt(FmtChannels chans, FmtType type)
-{ return ChannelsFromFmt(chans) * BytesFromFmt(type); }
+ALuint BytesFromFmt(FmtType type) noexcept;
+ALuint ChannelsFromFmt(FmtChannels chans) noexcept;
struct ALbuffer {
@@ -97,6 +95,10 @@ struct ALbuffer {
/* Self ID */
ALuint id{0};
+
+ inline ALuint bytesFromFmt() const noexcept { return BytesFromFmt(mFmtType); }
+ inline ALuint channelsFromFmt() const noexcept { return ChannelsFromFmt(mFmtChannels); }
+ inline ALuint frameSizeFromFmt() const noexcept { return channelsFromFmt() * bytesFromFmt(); }
};
#endif