From 2a123a4760d853eb300c684a6e3fc14efa86fe57 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 27 Nov 2010 00:32:53 -0800 Subject: Support 64-bit double buffers directly --- OpenAL32/Include/alBuffer.h | 1 + OpenAL32/alBuffer.c | 21 ++++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h index 06823ace..44a05915 100644 --- a/OpenAL32/Include/alBuffer.h +++ b/OpenAL32/Include/alBuffer.h @@ -11,6 +11,7 @@ enum FmtType { FmtUByte, FmtShort, FmtFloat, + FmtDouble, }; enum FmtChannels { diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 7dac47ff..2db0b3fd 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -287,9 +287,11 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid case AL_FORMAT_MONO8: case AL_FORMAT_MONO16: case AL_FORMAT_MONO_FLOAT32: + case AL_FORMAT_MONO_DOUBLE_EXT: case AL_FORMAT_STEREO8: case AL_FORMAT_STEREO16: case AL_FORMAT_STEREO_FLOAT32: + case AL_FORMAT_STEREO_DOUBLE_EXT: case AL_FORMAT_QUAD8_LOKI: case AL_FORMAT_QUAD16_LOKI: case AL_FORMAT_QUAD8: @@ -309,17 +311,6 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid alSetError(Context, err); break; - case AL_FORMAT_MONO_DOUBLE_EXT: - err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_MONO_FLOAT32); - if(err != AL_NO_ERROR) - alSetError(Context, err); - break; - case AL_FORMAT_STEREO_DOUBLE_EXT: - err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_STEREO_FLOAT32); - if(err != AL_NO_ERROR) - alSetError(Context, err); - break; - case AL_FORMAT_REAR8: case AL_FORMAT_REAR16: case AL_FORMAT_REAR32: { @@ -1064,11 +1055,7 @@ static ALenum LoadData(ALbuffer *ALBuf, const ALvoid *data, ALsizei size, ALuint ALvoid *temp; assert(NewChannels == OrigChannels); - assert(NewBytes == 4 || NewBytes == 2 || NewBytes == 1); - if(OrigBytes == 8) - assert(NewBytes == 4); - else - assert(NewBytes == OrigBytes); + assert(NewBytes == OrigBytes); if((size%(OrigBytes*OrigChannels)) != 0) return AL_INVALID_VALUE; @@ -1125,7 +1112,7 @@ static void ConvertData(ALvoid *dst, const ALvoid *src, ALint origBytes, ALsizei case 8: for(i = 0;i < len;i++) - ((ALfloat*)dst)[i] = ((ALdouble*)src)[i]; + ((ALdouble*)dst)[i] = ((ALdouble*)src)[i]; break; default: -- cgit v1.2.3