diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alSource.h | 3 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 22 |
2 files changed, 25 insertions, 0 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 54262779..1107bfd9 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -3,6 +3,7 @@ #define AL_NUM_SOURCE_PARAMS 128 +#include "alFilter.h" #include "AL/al.h" #define AL_DIRECT_FILTER 0x20005 @@ -59,6 +60,8 @@ typedef struct ALsource_struct ALuint BuffersPlayed; // Number of buffers played on this loop ALuint BufferPosition; // Read position in audio data of current buffer + ALfilter DirectFilter; + // Index to itself ALuint source; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index ec8783c3..dd1e482c 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -636,6 +636,22 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) alSetError(AL_INVALID_VALUE); break; + case AL_DIRECT_FILTER: + if(alIsFilter(lValue)) + { + ALfilter *filter = (ALfilter*)ALTHUNK_LOOKUPENTRY(lValue); + if(!filter) + { + pSource->DirectFilter.type = AL_FILTER_NULL; + pSource->DirectFilter.filter = 0; + } + else + memcpy(&pSource->DirectFilter, filter, sizeof(*filter)); + } + else + alSetError(AL_INVALID_VALUE); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -716,6 +732,7 @@ ALAPI void ALAPIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* plVa case AL_MAX_DISTANCE: case AL_ROLLOFF_FACTOR: case AL_REFERENCE_DISTANCE: + case AL_DIRECT_FILTER: alSourcei(source, eParam, plValues[0]); break; @@ -1044,6 +1061,10 @@ ALAPI ALvoid ALAPIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plValu alSetError(AL_INVALID_OPERATION); break; + case AL_DIRECT_FILTER: + *plValue = pSource->DirectFilter.filter; + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -1153,6 +1174,7 @@ ALAPI void ALAPIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plValue case AL_ROLLOFF_FACTOR: case AL_REFERENCE_DISTANCE: case AL_SOURCE_TYPE: + case AL_DIRECT_FILTER: alGetSourcei(source, eParam, plValues); break; |