diff options
author | Chris Robinson <[email protected]> | 2010-03-13 21:32:45 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-03-13 21:32:45 -0800 |
commit | c23e4ed412196e3632d0143be2d67fc2916e4fa8 (patch) | |
tree | 3e6e49cece216b9315051d7f20f56390c51ce5b1 | |
parent | 8c0118e7aefefe5180591aeafbcd34557b6a55d5 (diff) |
Add support for AL_EXT_DOUBLE
-rw-r--r-- | Alc/ALc.c | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 6 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 7 | ||||
-rw-r--r-- | OpenAL32/alExtension.c | 2 |
4 files changed, 17 insertions, 2 deletions
@@ -212,8 +212,8 @@ static ALCenum g_eLastContextError = ALC_NO_ERROR; // Default context extensions static const ALchar alExtList[] = - "AL_EXTX_buffer_sub_data AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 " - "AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS " + "AL_EXTX_buffer_sub_data AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE " + "AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS " "AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXTX_sample_buffer_object " "AL_EXT_source_distance_model AL_LOKI_quadriphonic"; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index a4e0930c..a309e6ef 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -110,6 +110,10 @@ static __inline ALuint aluBytesFromFormat(ALenum format) case AL_FORMAT_71CHN32: return 4; + case AL_FORMAT_MONO_DOUBLE_EXT: + case AL_FORMAT_STEREO_DOUBLE_EXT: + return 8; + default: return 0; } @@ -121,11 +125,13 @@ static __inline ALuint aluChannelsFromFormat(ALenum format) case AL_FORMAT_MONO8: case AL_FORMAT_MONO16: case AL_FORMAT_MONO_FLOAT32: + case AL_FORMAT_MONO_DOUBLE_EXT: return 1; case AL_FORMAT_STEREO8: case AL_FORMAT_STEREO16: case AL_FORMAT_STEREO_FLOAT32: + case AL_FORMAT_STEREO_DOUBLE_EXT: return 2; case AL_FORMAT_QUAD8_LOKI: diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 606a8fc5..ace59ceb 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -317,12 +317,14 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d case AL_FORMAT_MONO8: case AL_FORMAT_MONO16: case AL_FORMAT_MONO_FLOAT32: + case AL_FORMAT_MONO_DOUBLE_EXT: LoadData(ALBuf, data, size, freq, format, AL_FORMAT_MONO_FLOAT32); break; case AL_FORMAT_STEREO8: case AL_FORMAT_STEREO16: case AL_FORMAT_STEREO_FLOAT32: + case AL_FORMAT_STEREO_DOUBLE_EXT: LoadData(ALBuf, data, size, freq, format, AL_FORMAT_STEREO_FLOAT32); break; @@ -1119,6 +1121,11 @@ static void ConvertData(ALfloat *dst, const ALvoid *src, ALint origBytes, ALsize dst[i] = ((ALfloat*)src)[i]; break; + case 8: + for(i = 0;i < len;i++) + dst[i] = ((ALdouble*)src)[i]; + break; + default: assert(0); } diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c index c14385f8..3589ff63 100644 --- a/OpenAL32/alExtension.c +++ b/OpenAL32/alExtension.c @@ -228,9 +228,11 @@ static ALenums enumeration[]={ { (ALchar *)"AL_FORMAT_MONO8", AL_FORMAT_MONO8 }, { (ALchar *)"AL_FORMAT_MONO16", AL_FORMAT_MONO16 }, { (ALchar *)"AL_FORMAT_MONO_FLOAT32", AL_FORMAT_MONO_FLOAT32 }, + { (ALchar *)"AL_FORMAT_MONO_DOUBLE_EXT", AL_FORMAT_MONO_DOUBLE_EXT }, { (ALchar *)"AL_FORMAT_STEREO8", AL_FORMAT_STEREO8 }, { (ALchar *)"AL_FORMAT_STEREO16", AL_FORMAT_STEREO16 }, { (ALchar *)"AL_FORMAT_STEREO_FLOAT32", AL_FORMAT_STEREO_FLOAT32 }, + { (ALchar *)"AL_FORMAT_STEREO_DOUBLE_EXT", AL_FORMAT_STEREO_DOUBLE_EXT }, { (ALchar *)"AL_FORMAT_MONO_IMA4", AL_FORMAT_MONO_IMA4 }, { (ALchar *)"AL_FORMAT_STEREO_IMA4", AL_FORMAT_STEREO_IMA4 }, { (ALchar *)"AL_FORMAT_QUAD8_LOKI", AL_FORMAT_QUAD8_LOKI }, |