aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-27 00:32:53 -0800
committerChris Robinson <[email protected]>2010-11-27 00:32:53 -0800
commit2a123a4760d853eb300c684a6e3fc14efa86fe57 (patch)
tree6030c7ef916b0df2dec7f9ece405bfa9d790ac73 /OpenAL32
parent4689ffb72d4b068a374901ff5fbfff205b9aa70f (diff)
Support 64-bit double buffers directly
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alBuffer.h1
-rw-r--r--OpenAL32/alBuffer.c21
2 files changed, 5 insertions, 17 deletions
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: