diff options
author | Chris Robinson <[email protected]> | 2007-12-18 14:22:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-12-18 14:22:59 -0800 |
commit | cf03bfa1565db202c72e2c09ba9d32fd89c0f3b5 (patch) | |
tree | dfff73a966fdfb2f112c274e9f5f63981123b02a /OpenAL32/alAuxEffectSlot.c | |
parent | d4f556836aa434116d3e6384f4aa5465ff5d7ec3 (diff) |
Implement AL_EFFECTSLOT_EFFECT property
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 697589ee..8e76984f 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -156,15 +156,31 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param { ALCcontext *Context; - (void)iValue; - Context = alcGetCurrentContext(); SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) { + ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslot); + switch(param) { + case AL_EFFECTSLOT_EFFECT: + if(alIsEffect(iValue)) + { + ALeffect *effect = (ALeffect*)ALTHUNK_LOOKUPENTRY(iValue); + if(!effect) + { + ALEffectSlot->effect.type = AL_EFFECT_NULL; + ALEffectSlot->effect.effect = 0; + } + else + memcpy(&ALEffectSlot->effect, effect, sizeof(*effect)); + } + else + alSetError(AL_INVALID_VALUE); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -180,8 +196,6 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para { ALCcontext *Context; - (void)piValues; - Context = alcGetCurrentContext(); SuspendContext(Context); @@ -189,6 +203,10 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para { switch(param) { + case AL_EFFECTSLOT_EFFECT: + alAuxiliaryEffectSloti(effectslot, param, piValues[0]); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -252,15 +270,19 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa { ALCcontext *Context; - (void)piValue; - Context = alcGetCurrentContext(); SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) { + ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslot); + switch(param) { + case AL_EFFECTSLOT_EFFECT: + *piValue = ALEffectSlot->effect.effect; + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -276,8 +298,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p { ALCcontext *Context; - (void)piValues; - Context = alcGetCurrentContext(); SuspendContext(Context); @@ -285,6 +305,10 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p { switch(param) { + case AL_EFFECTSLOT_EFFECT: + alGetAuxiliaryEffectSloti(effectslot, param, piValues); + break; + default: alSetError(AL_INVALID_ENUM); break; |