diff options
author | Chris Robinson <[email protected]> | 2018-01-21 18:34:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-21 18:34:03 -0800 |
commit | db13af1935f969bb579fca9d79c6600d91c0fe32 (patch) | |
tree | d69b0a669a9cf096bd71e90970a0ad8f5d064458 /OpenAL32/alBuffer.c | |
parent | efd11f32a20c8fa06161a42facc5b97180c0c1a5 (diff) |
Handle double-precision buffers in the mixer
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index e0f2160d..e9efd2c8 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -173,6 +173,7 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoi case UserFmtUByte: case UserFmtShort: case UserFmtFloat: + case UserFmtDouble: case UserFmtMulaw: case UserFmtAlaw: framesize = FrameSizeFromUserFmt(srcchannels, srctype) * align; @@ -186,30 +187,6 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoi SET_ERROR_AND_GOTO(context, err, done); break; - case UserFmtDouble: - framesize = FrameSizeFromUserFmt(srcchannels, srctype) * align; - if((size%framesize) != 0) - SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); - - switch(srcchannels) - { - case UserFmtMono: newformat = AL_FORMAT_MONO_FLOAT32; break; - case UserFmtStereo: newformat = AL_FORMAT_STEREO_FLOAT32; break; - case UserFmtRear: newformat = AL_FORMAT_REAR32; break; - case UserFmtQuad: newformat = AL_FORMAT_QUAD32; break; - case UserFmtX51: newformat = AL_FORMAT_51CHN32; break; - case UserFmtX61: newformat = AL_FORMAT_61CHN32; break; - case UserFmtX71: newformat = AL_FORMAT_71CHN32; break; - case UserFmtBFormat2D: newformat = AL_FORMAT_BFORMAT2D_FLOAT32; break; - case UserFmtBFormat3D: newformat = AL_FORMAT_BFORMAT3D_FLOAT32; break; - } - err = LoadData(albuf, freq, newformat, size/framesize*align, - srcchannels, srctype, data, align, format&ACCESS_FLAGS, - AL_TRUE); - if(err != AL_NO_ERROR) - SET_ERROR_AND_GOTO(context, err, done); - break; - case UserFmtIMA4: framesize = (align-1)/2 + 4; framesize *= ChannelsFromUserFmt(srcchannels); @@ -1141,6 +1118,7 @@ ALsizei BytesFromFmt(enum FmtType type) case FmtUByte: return sizeof(ALubyte); case FmtShort: return sizeof(ALshort); case FmtFloat: return sizeof(ALfloat); + case FmtDouble: return sizeof(ALdouble); case FmtMulaw: return sizeof(ALubyte); case FmtAlaw: return sizeof(ALubyte); } |