aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-28 23:07:57 -0800
committerChris Robinson <[email protected]>2010-11-28 23:07:57 -0800
commiteb489ac886416fb9b234458a357039c328ba11a5 (patch)
tree4cc3811586d447ccd750ac0286557b16003d021e /OpenAL32
parent986628b8b202c497f876f94135d5d6b855f7541f (diff)
Store double formats as float
The mixer will cut it down to float anyway, so it's unnecessary and needlessly creates more mixer functions
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alBuffer.h2
-rw-r--r--OpenAL32/alBuffer.c25
2 files changed, 12 insertions, 15 deletions
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h
index 1347eebd..8230f2b0 100644
--- a/OpenAL32/Include/alBuffer.h
+++ b/OpenAL32/Include/alBuffer.h
@@ -70,7 +70,6 @@ enum FmtType {
FmtUByte,
FmtShort,
FmtFloat,
- FmtDouble,
};
enum FmtChannels {
FmtMono,
@@ -91,7 +90,6 @@ static __inline ALuint BytesFromFmt(enum FmtType type)
case FmtUByte: return sizeof(ALubyte);
case FmtShort: return sizeof(ALshort);
case FmtFloat: return sizeof(ALfloat);
- case FmtDouble: return sizeof(ALdouble);
}
return 0;
}
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index de79d8e4..c3c866d9 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -285,11 +285,9 @@ 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:
@@ -312,6 +310,17 @@ 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_MONO_MULAW:
case AL_FORMAT_STEREO_MULAW:
case AL_FORMAT_QUAD_MULAW:
@@ -1249,9 +1258,7 @@ static void ConvertData(ALvoid *dst, enum FmtType dstType, const ALvoid *src, en
case FmtFloat:
Convert_ALfloat(dst, src, srcType, len);
break;
- case FmtDouble:
- Convert_ALdouble(dst, src, srcType, len);
- break;
+ (void)Convert_ALdouble;
}
}
@@ -1406,10 +1413,6 @@ void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order)
*type = FmtFloat;
*order = FmtMono;
break;
- case AL_FORMAT_MONO_DOUBLE_EXT:
- *type = FmtDouble;
- *order = FmtMono;
- break;
case AL_FORMAT_STEREO8:
*type = FmtUByte;
*order = FmtStereo;
@@ -1422,10 +1425,6 @@ void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order)
*type = FmtFloat;
*order = FmtStereo;
break;
- case AL_FORMAT_STEREO_DOUBLE_EXT:
- *type = FmtDouble;
- *order = FmtStereo;
- break;
case AL_FORMAT_QUAD8_LOKI:
case AL_FORMAT_QUAD8:
*type = FmtUByte;