diff options
author | Chris Robinson <[email protected]> | 2007-12-18 17:59:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-12-18 17:59:28 -0800 |
commit | a281027876f8ba0f7abf36c2864c3f7cfc984408 (patch) | |
tree | 9afe936c96895d9c360a2ce111b337552dbb9b79 /OpenAL32/alSource.c | |
parent | 72ce653bcf665d31908f94a4e321db370a162e4e (diff) |
Implement AL_AUXILIARY_SEND_FILTER source property
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 03ae10b6..bc81cd2c 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -710,6 +710,8 @@ ALAPI void ALAPIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, AL if (alIsSource(source)) { + ALsource *pSource = ((ALsource *)ALTHUNK_LOOKUPENTRY(source)); + switch (eParam) { case AL_POSITION: @@ -718,6 +720,34 @@ ALAPI void ALAPIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, AL alSource3f(source, eParam, (ALfloat)lValue1, (ALfloat)lValue2, (ALfloat)lValue3); break; + case AL_AUXILIARY_SEND_FILTER: + if(lValue2 >= 0 && lValue2 <= 0 && + alIsAuxiliaryEffectSlot(lValue1) && alIsFilter(lValue3)) + { + ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(lValue1); + ALfilter *ALFilter = (ALfilter*)ALTHUNK_LOOKUPENTRY(lValue3); + + if(!ALEffectSlot) + { + /* Disable slot */ + pSource->Send[lValue2].Slot.effectslot = 0; + } + else + memcpy(&pSource->Send[lValue2].Slot, ALEffectSlot, sizeof(*ALEffectSlot)); + + if(!ALFilter) + { + /* Disable filter */ + pSource->Send[lValue2].WetFilter.type = 0; + pSource->Send[lValue2].WetFilter.filter = 0; + } + else + memcpy(&pSource->Send[lValue2].WetFilter, ALFilter, sizeof(*ALFilter)); + } + else + alSetError(AL_INVALID_VALUE); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -771,6 +801,7 @@ ALAPI void ALAPIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* plVa case AL_POSITION: case AL_VELOCITY: case AL_DIRECTION: + case AL_AUXILIARY_SEND_FILTER: alSource3i(source, eParam, plValues[0], plValues[1], plValues[2]); break; |