Fix the retrieval of the RW offsets using the correct functions

This commit is contained in:
Chris Robinson 2010-03-10 07:33:30 -08:00
parent 08b1bed38b
commit b734cab6fc
2 changed files with 31 additions and 31 deletions

View File

@ -901,20 +901,6 @@ ALAPI ALvoid ALAPIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pflV
alSetError(AL_INVALID_OPERATION);
break;
case AL_SEC_RW_OFFSETS_EXT:
case AL_SAMPLE_RW_OFFSETS_EXT:
case AL_BYTE_RW_OFFSETS_EXT:
updateLen = (ALfloat)pContext->Device->UpdateSize /
pContext->Device->Frequency;
if(GetSourceOffset(pSource, eParam, flOffset, updateLen))
{
pflValue[0] = flOffset[0];
pflValue[1] = flOffset[1];
}
else
alSetError(AL_INVALID_OPERATION);
break;
case AL_CONE_INNER_ANGLE:
*pflValue = pSource->flInnerAngle;
break;
@ -1005,8 +991,10 @@ ALAPI ALvoid ALAPIENTRY alGetSource3f(ALuint source, ALenum eParam, ALfloat* pfl
ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *pflValues)
{
ALCcontext *pContext;
ALCcontext *pContext;
ALsource *pSource;
ALfloat flOffset[2];
ALfloat updateLen;
pContext = GetContextSuspended();
if(!pContext) return;
@ -1039,6 +1027,19 @@ ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *pfl
alGetSourcef(source, eParam, pflValues);
break;
case AL_SAMPLE_RW_OFFSETS_EXT:
case AL_BYTE_RW_OFFSETS_EXT:
updateLen = (ALfloat)pContext->Device->UpdateSize /
pContext->Device->Frequency;
if(GetSourceOffset(pSource, eParam, flOffset, updateLen))
{
pflValues[0] = flOffset[0];
pflValues[1] = flOffset[1];
}
else
alSetError(AL_INVALID_OPERATION);
break;
case AL_POSITION:
pflValues[0] = pSource->vPosition[0];
pflValues[1] = pSource->vPosition[1];
@ -1156,20 +1157,6 @@ ALAPI ALvoid ALAPIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plValu
alSetError(AL_INVALID_OPERATION);
break;
case AL_SEC_RW_OFFSETS_EXT:
case AL_SAMPLE_RW_OFFSETS_EXT:
case AL_BYTE_RW_OFFSETS_EXT:
updateLen = (ALfloat)pContext->Device->UpdateSize /
pContext->Device->Frequency;
if(GetSourceOffset(pSource, eParam, flOffset, updateLen))
{
plValue[0] = (ALint)flOffset[0];
plValue[1] = (ALint)flOffset[1];
}
else
alSetError(AL_INVALID_OPERATION);
break;
case AL_DIRECT_FILTER:
*plValue = pSource->DirectFilter.filter;
break;
@ -1262,6 +1249,8 @@ ALAPI void ALAPIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plValue
{
ALCcontext *pContext;
ALsource *pSource;
ALfloat flOffset[2];
ALfloat updateLen;
pContext = GetContextSuspended();
if(!pContext) return;
@ -1298,6 +1287,19 @@ ALAPI void ALAPIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plValue
alGetSourcei(source, eParam, plValues);
break;
case AL_SAMPLE_RW_OFFSETS_EXT:
case AL_BYTE_RW_OFFSETS_EXT:
updateLen = (ALfloat)pContext->Device->UpdateSize /
pContext->Device->Frequency;
if(GetSourceOffset(pSource, eParam, flOffset, updateLen))
{
plValues[0] = (ALint)flOffset[0];
plValues[1] = (ALint)flOffset[1];
}
else
alSetError(AL_INVALID_OPERATION);
break;
case AL_POSITION:
plValues[0] = (ALint)pSource->vPosition[0];
plValues[1] = (ALint)pSource->vPosition[1];
@ -1923,7 +1925,6 @@ static ALboolean GetSourceOffset(ALsource *pSource, ALenum eName, ALfloat *pflOf
switch (eName)
{
case AL_SEC_OFFSET:
case AL_SEC_RW_OFFSETS_EXT:
pflOffset[0] = (ALfloat)readPos / (lChannels * lBytes * flBufferFreq);
pflOffset[1] = (ALfloat)writePos / (lChannels * lBytes * flBufferFreq);
break;

View File

@ -101,7 +101,6 @@ extern "C" {
#define AL_EXT_buffer_sub_data 1
#define AL_BYTE_RW_OFFSETS_EXT 0x1031
#define AL_SAMPLE_RW_OFFSETS_EXT 0x1032
#define AL_SEC_RW_OFFSETS_EXT 0x1033
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATAEXTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
#endif