AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects) { ALCdevice *device; ALCcontext *context; ALeffect *effect; ALsizei i; context = GetContextRef(); if(!context) return; device = context->Device; LockEffectList(device); if(n < 0) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d effects", n); for(i = 0;i < n;i++) { if(effects[i] && LookupEffect(device, effects[i]) == NULL) SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect ID %u", effects[i]); } for(i = 0;i < n;i++) { if((effect=LookupEffect(device, effects[i])) != NULL) FreeEffect(device, effect); } done: UnlockEffectList(device); ALCcontext_DecRef(context); }
void FfbHandle_BlockFree(USB_FFBReport_BlockFree_Output_Data_t* data) { uint8_t eid = data->effectBlockIndex; if (eid == 0xFF) { // all effects FreeAllEffects(); } else { FreeEffect(eid); } }