summaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-10 07:33:30 -0800
committerChris Robinson <[email protected]>2010-03-10 07:33:30 -0800
commitb734cab6fcbd7d3338c04fd9a90f6dca39ef2827 (patch)
tree8be4285c3b49b760534f3a2ab60902e4f48891c7 /OpenAL32
parent08b1bed38b86aee00b47843854cd9b7a2749c4f8 (diff)
Fix the retrieval of the RW offsets using the correct functions
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/alSource.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 2fd1ad15..a2375d49 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -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;