diff options
author | Chris Robinson <[email protected]> | 2007-12-17 19:40:43 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-12-17 19:40:43 -0800 |
commit | 28f80fa113be3488e98abb9fd6863277d2b94180 (patch) | |
tree | b8f824734ae62e77bf0069c4d8a7eb769e475ec2 /OpenAL32 | |
parent | 9ebf1c1431b18b174473c107b738199ad93860f2 (diff) |
Add AL_METERS_PER_UNIT listener property
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alListener.h | 1 | ||||
-rw-r--r-- | OpenAL32/alListener.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/OpenAL32/Include/alListener.h b/OpenAL32/Include/alListener.h index 587b2151..d22261fa 100644 --- a/OpenAL32/Include/alListener.h +++ b/OpenAL32/Include/alListener.h @@ -16,6 +16,7 @@ typedef struct ALlistener_struct ALfloat Forward[3]; ALfloat Up[3]; ALfloat Gain; + ALfloat MetersPerUnit; } ALlistener; #ifdef __cplusplus diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c index 97fc593c..1e02622a 100644 --- a/OpenAL32/alListener.c +++ b/OpenAL32/alListener.c @@ -41,6 +41,13 @@ ALAPI ALvoid ALAPIENTRY alListenerf(ALenum eParam, ALfloat flValue) alSetError(AL_INVALID_VALUE); break; + case AL_METERS_PER_UNIT: + if (flValue > 0.0f) + pContext->Listener.MetersPerUnit = flValue; + else + alSetError(AL_INVALID_VALUE); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -112,6 +119,13 @@ ALAPI ALvoid ALAPIENTRY alListenerfv(ALenum eParam, const ALfloat *pflValues) alSetError(AL_INVALID_VALUE); break; + case AL_METERS_PER_UNIT: + if (pflValues[0] > 0.0f) + pContext->Listener.MetersPerUnit = pflValues[0]; + else + alSetError(AL_INVALID_VALUE); + break; + case AL_POSITION: pContext->Listener.Position[0] = pflValues[0]; pContext->Listener.Position[1] = pflValues[1]; @@ -274,6 +288,10 @@ ALAPI ALvoid ALAPIENTRY alGetListenerf(ALenum eParam, ALfloat *pflValue) *pflValue = pContext->Listener.Gain; break; + case AL_METERS_PER_UNIT: + *pflValue = pContext->Listener.MetersPerUnit; + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -350,6 +368,10 @@ ALAPI ALvoid ALAPIENTRY alGetListenerfv(ALenum eParam, ALfloat *pflValues) pflValues[0] = pContext->Listener.Gain; break; + case AL_METERS_PER_UNIT: + pflValues[0] = pContext->Listener.MetersPerUnit; + break; + case AL_POSITION: pflValues[0] = pContext->Listener.Position[0]; pflValues[1] = pContext->Listener.Position[1]; |