aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-18 13:37:07 -0800
committerChris Robinson <[email protected]>2007-12-18 13:37:07 -0800
commitebb30ec5b0e219fdf2b21fbfdd1be6e17cb31376 (patch)
tree75ec156208d2caf3cd0395e437dd8332a66ae8d3 /OpenAL32/alSource.c
parent168d8e3beee5f809f79f6d0067cd51e25ba65295 (diff)
Implement AL_AIR_ABSORPTION_FACTOR source property
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 1e30b1db..65bfcb22 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -348,6 +348,13 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue)
alSetError(AL_INVALID_VALUE);
break;
+ case AL_AIR_ABSORPTION_FACTOR:
+ if (flValue >= 0.0f && flValue <= 10.0f)
+ pSource->AirAbsorptionFactor = flValue;
+ else
+ alSetError(AL_INVALID_VALUE);
+ break;
+
case AL_SEC_OFFSET:
case AL_SAMPLE_OFFSET:
case AL_BYTE_OFFSET:
@@ -472,6 +479,7 @@ ALAPI ALvoid ALAPIENTRY alSourcefv(ALuint source, ALenum eParam, const ALfloat *
case AL_SEC_OFFSET:
case AL_SAMPLE_OFFSET:
case AL_BYTE_OFFSET:
+ case AL_AIR_ABSORPTION_FACTOR:
alSourcef(source, eParam, pflValues[0]);
break;
@@ -850,6 +858,10 @@ ALAPI ALvoid ALAPIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pflV
*pflValue = pSource->flRefDistance;
break;
+ case AL_AIR_ABSORPTION_FACTOR:
+ *pflValue = pSource->AirAbsorptionFactor;
+ break;
+
default:
alSetError(AL_INVALID_ENUM);
break;
@@ -958,6 +970,7 @@ ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *pfl
case AL_CONE_OUTER_ANGLE:
case AL_REFERENCE_DISTANCE:
case AL_CONE_OUTER_GAINHF:
+ case AL_AIR_ABSORPTION_FACTOR:
alGetSourcef(source, eParam, pflValues);
break;
@@ -1879,6 +1892,7 @@ static ALvoid InitSourceParams(ALsource *pSource)
pSource->flOuterGain = 0.0f;
pSource->DryGainHFAuto = AL_TRUE;
+ pSource->AirAbsorptionFactor = 0.0f;
pSource->state = AL_INITIAL;
pSource->lSourceType = AL_UNDETERMINED;