diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2010-11-29 15:01:27 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2010-11-29 15:01:27 -0800 |
commit | f74032d24480cbbf17e294a0ca8c1ab6be7d3a96 (patch) | |
tree | 28b925c2cb6ebe820e34f29a4a37c3b15aec69ef /OpenAL32/alBuffer.c | |
parent | eb489ac886416fb9b234458a357039c328ba11a5 (diff) |
Uninline a couple more functions
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index c3c866d9..7c4cd2e9 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -1263,6 +1263,34 @@ static void ConvertData(ALvoid *dst, enum FmtType dstType, const ALvoid *src, en } +ALuint BytesFromSrcFmt(enum SrcFmtType type) +{ + switch(type) + { + case SrcFmtByte: return sizeof(ALbyte); + case SrcFmtUByte: return sizeof(ALubyte); + case SrcFmtShort: return sizeof(ALshort); + case SrcFmtUShort: return sizeof(ALushort); + case SrcFmtFloat: return sizeof(ALfloat); + case SrcFmtDouble: return sizeof(ALdouble); + case SrcFmtMulaw: return sizeof(ALubyte); + } + return 0; +} +ALuint ChannelsFromSrcFmt(enum SrcFmtChannels chans) +{ + switch(chans) + { + case SrcFmtMono: return 1; + case SrcFmtStereo: return 2; + case SrcFmtRear: return 2; + case SrcFmtQuad: return 4; + case SrcFmtX51: return 6; + case SrcFmtX61: return 7; + case SrcFmtX71: return 8; + } + return 0; +} void DecomposeInputFormat(ALenum format, enum SrcFmtType *type, enum SrcFmtChannels *order) { @@ -1397,6 +1425,30 @@ void DecomposeInputFormat(ALenum format, enum SrcFmtType *type, } } +ALuint BytesFromFmt(enum FmtType type) +{ + switch(type) + { + case FmtUByte: return sizeof(ALubyte); + case FmtShort: return sizeof(ALshort); + case FmtFloat: return sizeof(ALfloat); + } + return 0; +} +ALuint ChannelsFromFmt(enum FmtChannels chans) +{ + switch(chans) + { + case FmtMono: return 1; + case FmtStereo: return 2; + case FmtRear: return 2; + case FmtQuad: return 4; + case FmtX51: return 6; + case FmtX61: return 7; + case FmtX71: return 8; + } + return 0; +} void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order) { switch(format) |