diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 3 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 40 |
2 files changed, 40 insertions, 3 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index ff1b3d4f..8b8db208 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -518,9 +518,6 @@ void SetDefaultWFXChannelOrder(ALCdevice *device); const ALCchar *DevFmtTypeString(enum DevFmtType type); const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans); -ALboolean IsValidType(ALenum type); -ALboolean IsValidChannels(ALenum type); - #define HRIR_BITS (5) #define HRIR_LENGTH (1<<HRIR_BITS) #define HRIR_MASK (HRIR_LENGTH-1) diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 604a3f5e..306d240d 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -35,6 +35,8 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels chans, enum UserFmtType type, const ALvoid *data, ALboolean storesrc); static void ConvertData(ALvoid *dst, enum UserFmtType dstType, const ALvoid *src, enum UserFmtType srcType, ALsizei numchans, ALsizei len); +static ALboolean IsValidType(ALenum type); +static ALboolean IsValidChannels(ALenum channels); #define LookupBuffer(m, k) ((ALbuffer*)LookupUIntMapKey(&(m), (k))) @@ -2156,6 +2158,44 @@ ALboolean DecomposeFormat(ALenum format, enum FmtChannels *chans, enum FmtType * } +static ALboolean IsValidType(ALenum type) +{ + switch(type) + { + case AL_BYTE: + case AL_UNSIGNED_BYTE: + case AL_SHORT: + case AL_UNSIGNED_SHORT: + case AL_INT: + case AL_UNSIGNED_INT: + case AL_FLOAT: + case AL_DOUBLE: + case AL_MULAW: + case AL_IMA4: + case AL_BYTE3: + case AL_UNSIGNED_BYTE3: + return AL_TRUE; + } + return AL_FALSE; +} + +static ALboolean IsValidChannels(ALenum channels) +{ + switch(channels) + { + case AL_MONO: + case AL_STEREO: + case AL_REAR: + case AL_QUAD: + case AL_5POINT1: + case AL_6POINT1: + case AL_7POINT1: + return AL_TRUE; + } + return AL_FALSE; +} + + /* * ReleaseALBuffers() * |