2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
34 ALboolean DisabledEffects
[MAX_EFFECTS
];
37 static void InitEffectParams(ALeffect
*effect
, ALenum type
);
40 AL_API ALvoid AL_APIENTRY
alGenEffects(ALsizei n
, ALuint
*effects
)
45 Context
= GetContextRef();
48 if(n
< 0 || IsBadWritePtr((void*)effects
, n
* sizeof(ALuint
)))
49 alSetError(Context
, AL_INVALID_VALUE
);
52 ALCdevice
*device
= Context
->Device
;
57 ALeffect
*effect
= calloc(1, sizeof(ALeffect
));
60 alSetError(Context
, AL_OUT_OF_MEMORY
);
61 alDeleteEffects(i
, effects
);
64 InitEffectParams(effect
, AL_EFFECT_NULL
);
66 err
= NewThunkEntry(&effect
->effect
);
67 if(err
== AL_NO_ERROR
)
68 err
= InsertUIntMapEntry(&device
->EffectMap
, effect
->effect
, effect
);
69 if(err
!= AL_NO_ERROR
)
71 FreeThunkEntry(effect
->effect
);
72 memset(effect
, 0, sizeof(ALeffect
));
75 alSetError(Context
, err
);
76 alDeleteEffects(i
, effects
);
80 effects
[i
] = effect
->effect
;
84 ALCcontext_DecRef(Context
);
87 AL_API ALvoid AL_APIENTRY
alDeleteEffects(ALsizei n
, const ALuint
*effects
)
94 Context
= GetContextRef();
97 device
= Context
->Device
;
99 alSetError(Context
, AL_INVALID_VALUE
);
102 // Check that all effects are valid
108 if(LookupEffect(device
, effects
[i
]) == NULL
)
110 alSetError(Context
, AL_INVALID_NAME
);
118 // Recheck that the effect is valid, because there could be duplicated names
119 if((ALEffect
=RemoveEffect(device
, effects
[i
])) == NULL
)
121 FreeThunkEntry(ALEffect
->effect
);
123 memset(ALEffect
, 0, sizeof(ALeffect
));
128 ALCcontext_DecRef(Context
);
131 AL_API ALboolean AL_APIENTRY
alIsEffect(ALuint effect
)
136 Context
= GetContextRef();
137 if(!Context
) return AL_FALSE
;
139 result
= ((!effect
|| LookupEffect(Context
->Device
, effect
)) ?
142 ALCcontext_DecRef(Context
);
147 AL_API ALvoid AL_APIENTRY
alEffecti(ALuint effect
, ALenum param
, ALint iValue
)
153 Context
= GetContextRef();
156 Device
= Context
->Device
;
157 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
159 if(param
== AL_EFFECT_TYPE
)
161 ALboolean isOk
= (iValue
== AL_EFFECT_NULL
);
163 for(i
= 0;!isOk
&& EffectList
[i
].val
;i
++)
165 if(iValue
== EffectList
[i
].val
&&
166 !DisabledEffects
[EffectList
[i
].type
])
171 InitEffectParams(ALEffect
, iValue
);
173 alSetError(Context
, AL_INVALID_VALUE
);
177 /* Call the appropriate handler */
178 ALeffect_SetParami(ALEffect
, Context
, param
, iValue
);
182 alSetError(Context
, AL_INVALID_NAME
);
184 ALCcontext_DecRef(Context
);
187 AL_API ALvoid AL_APIENTRY
alEffectiv(ALuint effect
, ALenum param
, const ALint
*piValues
)
193 Context
= GetContextRef();
196 Device
= Context
->Device
;
197 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
199 /* Call the appropriate handler */
200 ALeffect_SetParamiv(ALEffect
, Context
, param
, piValues
);
203 alSetError(Context
, AL_INVALID_NAME
);
205 ALCcontext_DecRef(Context
);
208 AL_API ALvoid AL_APIENTRY
alEffectf(ALuint effect
, ALenum param
, ALfloat flValue
)
214 Context
= GetContextRef();
217 Device
= Context
->Device
;
218 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
220 /* Call the appropriate handler */
221 ALeffect_SetParamf(ALEffect
, Context
, param
, flValue
);
224 alSetError(Context
, AL_INVALID_NAME
);
226 ALCcontext_DecRef(Context
);
229 AL_API ALvoid AL_APIENTRY
alEffectfv(ALuint effect
, ALenum param
, const ALfloat
*pflValues
)
235 Context
= GetContextRef();
238 Device
= Context
->Device
;
239 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
241 /* Call the appropriate handler */
242 ALeffect_SetParamfv(ALEffect
, Context
, param
, pflValues
);
245 alSetError(Context
, AL_INVALID_NAME
);
247 ALCcontext_DecRef(Context
);
250 AL_API ALvoid AL_APIENTRY
alGetEffecti(ALuint effect
, ALenum param
, ALint
*piValue
)
256 Context
= GetContextRef();
259 Device
= Context
->Device
;
260 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
262 if(param
== AL_EFFECT_TYPE
)
264 *piValue
= ALEffect
->type
;
268 /* Call the appropriate handler */
269 ALeffect_GetParamiv(ALEffect
, Context
, param
, piValue
);
273 alSetError(Context
, AL_INVALID_NAME
);
275 ALCcontext_DecRef(Context
);
278 AL_API ALvoid AL_APIENTRY
alGetEffectiv(ALuint effect
, ALenum param
, ALint
*piValues
)
284 Context
= GetContextRef();
287 Device
= Context
->Device
;
288 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
290 /* Call the appropriate handler */
291 ALeffect_GetParamiv(ALEffect
, Context
, param
, piValues
);
294 alSetError(Context
, AL_INVALID_NAME
);
296 ALCcontext_DecRef(Context
);
299 AL_API ALvoid AL_APIENTRY
alGetEffectf(ALuint effect
, ALenum param
, ALfloat
*pflValue
)
305 Context
= GetContextRef();
308 Device
= Context
->Device
;
309 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
311 /* Call the appropriate handler */
312 ALeffect_GetParamf(ALEffect
, Context
, param
, pflValue
);
315 alSetError(Context
, AL_INVALID_NAME
);
317 ALCcontext_DecRef(Context
);
320 AL_API ALvoid AL_APIENTRY
alGetEffectfv(ALuint effect
, ALenum param
, ALfloat
*pflValues
)
326 Context
= GetContextRef();
329 Device
= Context
->Device
;
330 if((ALEffect
=LookupEffect(Device
, effect
)) != NULL
)
332 /* Call the appropriate handler */
333 ALeffect_GetParamfv(ALEffect
, Context
, param
, pflValues
);
336 alSetError(Context
, AL_INVALID_NAME
);
338 ALCcontext_DecRef(Context
);
342 static void eaxreverb_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
346 case AL_EAXREVERB_DECAY_HFLIMIT
:
347 if(val
>= AL_EAXREVERB_MIN_DECAY_HFLIMIT
&& val
<= AL_EAXREVERB_MAX_DECAY_HFLIMIT
)
348 effect
->Reverb
.DecayHFLimit
= val
;
350 alSetError(context
, AL_INVALID_VALUE
);
354 alSetError(context
, AL_INVALID_ENUM
);
358 static void eaxreverb_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
360 eaxreverb_SetParami(effect
, context
, param
, vals
[0]);
362 static void eaxreverb_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
366 case AL_EAXREVERB_DENSITY
:
367 if(val
>= AL_EAXREVERB_MIN_DENSITY
&&
368 val
<= AL_EAXREVERB_MAX_DENSITY
)
369 effect
->Reverb
.Density
= val
;
371 alSetError(context
, AL_INVALID_VALUE
);
374 case AL_EAXREVERB_DIFFUSION
:
375 if(val
>= AL_EAXREVERB_MIN_DIFFUSION
&&
376 val
<= AL_EAXREVERB_MAX_DIFFUSION
)
377 effect
->Reverb
.Diffusion
= val
;
379 alSetError(context
, AL_INVALID_VALUE
);
382 case AL_EAXREVERB_GAIN
:
383 if(val
>= AL_EAXREVERB_MIN_GAIN
&&
384 val
<= AL_EAXREVERB_MAX_GAIN
)
385 effect
->Reverb
.Gain
= val
;
387 alSetError(context
, AL_INVALID_VALUE
);
390 case AL_EAXREVERB_GAINHF
:
391 if(val
>= AL_EAXREVERB_MIN_GAINHF
&&
392 val
<= AL_EAXREVERB_MAX_GAINHF
)
393 effect
->Reverb
.GainHF
= val
;
395 alSetError(context
, AL_INVALID_VALUE
);
398 case AL_EAXREVERB_GAINLF
:
399 if(val
>= AL_EAXREVERB_MIN_GAINLF
&&
400 val
<= AL_EAXREVERB_MAX_GAINLF
)
401 effect
->Reverb
.GainLF
= val
;
403 alSetError(context
, AL_INVALID_VALUE
);
406 case AL_EAXREVERB_DECAY_TIME
:
407 if(val
>= AL_EAXREVERB_MIN_DECAY_TIME
&&
408 val
<= AL_EAXREVERB_MAX_DECAY_TIME
)
409 effect
->Reverb
.DecayTime
= val
;
411 alSetError(context
, AL_INVALID_VALUE
);
414 case AL_EAXREVERB_DECAY_HFRATIO
:
415 if(val
>= AL_EAXREVERB_MIN_DECAY_HFRATIO
&&
416 val
<= AL_EAXREVERB_MAX_DECAY_HFRATIO
)
417 effect
->Reverb
.DecayHFRatio
= val
;
419 alSetError(context
, AL_INVALID_VALUE
);
422 case AL_EAXREVERB_DECAY_LFRATIO
:
423 if(val
>= AL_EAXREVERB_MIN_DECAY_LFRATIO
&&
424 val
<= AL_EAXREVERB_MAX_DECAY_LFRATIO
)
425 effect
->Reverb
.DecayLFRatio
= val
;
427 alSetError(context
, AL_INVALID_VALUE
);
430 case AL_EAXREVERB_REFLECTIONS_GAIN
:
431 if(val
>= AL_EAXREVERB_MIN_REFLECTIONS_GAIN
&&
432 val
<= AL_EAXREVERB_MAX_REFLECTIONS_GAIN
)
433 effect
->Reverb
.ReflectionsGain
= val
;
435 alSetError(context
, AL_INVALID_VALUE
);
438 case AL_EAXREVERB_REFLECTIONS_DELAY
:
439 if(val
>= AL_EAXREVERB_MIN_REFLECTIONS_DELAY
&&
440 val
<= AL_EAXREVERB_MAX_REFLECTIONS_DELAY
)
441 effect
->Reverb
.ReflectionsDelay
= val
;
443 alSetError(context
, AL_INVALID_VALUE
);
446 case AL_EAXREVERB_LATE_REVERB_GAIN
:
447 if(val
>= AL_EAXREVERB_MIN_LATE_REVERB_GAIN
&&
448 val
<= AL_EAXREVERB_MAX_LATE_REVERB_GAIN
)
449 effect
->Reverb
.LateReverbGain
= val
;
451 alSetError(context
, AL_INVALID_VALUE
);
454 case AL_EAXREVERB_LATE_REVERB_DELAY
:
455 if(val
>= AL_EAXREVERB_MIN_LATE_REVERB_DELAY
&&
456 val
<= AL_EAXREVERB_MAX_LATE_REVERB_DELAY
)
457 effect
->Reverb
.LateReverbDelay
= val
;
459 alSetError(context
, AL_INVALID_VALUE
);
462 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF
:
463 if(val
>= AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF
&&
464 val
<= AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF
)
465 effect
->Reverb
.AirAbsorptionGainHF
= val
;
467 alSetError(context
, AL_INVALID_VALUE
);
470 case AL_EAXREVERB_ECHO_TIME
:
471 if(val
>= AL_EAXREVERB_MIN_ECHO_TIME
&&
472 val
<= AL_EAXREVERB_MAX_ECHO_TIME
)
473 effect
->Reverb
.EchoTime
= val
;
475 alSetError(context
, AL_INVALID_VALUE
);
478 case AL_EAXREVERB_ECHO_DEPTH
:
479 if(val
>= AL_EAXREVERB_MIN_ECHO_DEPTH
&&
480 val
<= AL_EAXREVERB_MAX_ECHO_DEPTH
)
481 effect
->Reverb
.EchoDepth
= val
;
483 alSetError(context
, AL_INVALID_VALUE
);
486 case AL_EAXREVERB_MODULATION_TIME
:
487 if(val
>= AL_EAXREVERB_MIN_MODULATION_TIME
&&
488 val
<= AL_EAXREVERB_MAX_MODULATION_TIME
)
489 effect
->Reverb
.ModulationTime
= val
;
491 alSetError(context
, AL_INVALID_VALUE
);
494 case AL_EAXREVERB_MODULATION_DEPTH
:
495 if(val
>= AL_EAXREVERB_MIN_MODULATION_DEPTH
&&
496 val
<= AL_EAXREVERB_MAX_MODULATION_DEPTH
)
497 effect
->Reverb
.ModulationDepth
= val
;
499 alSetError(context
, AL_INVALID_VALUE
);
502 case AL_EAXREVERB_HFREFERENCE
:
503 if(val
>= AL_EAXREVERB_MIN_HFREFERENCE
&&
504 val
<= AL_EAXREVERB_MAX_HFREFERENCE
)
505 effect
->Reverb
.HFReference
= val
;
507 alSetError(context
, AL_INVALID_VALUE
);
510 case AL_EAXREVERB_LFREFERENCE
:
511 if(val
>= AL_EAXREVERB_MIN_LFREFERENCE
&&
512 val
<= AL_EAXREVERB_MAX_LFREFERENCE
)
513 effect
->Reverb
.LFReference
= val
;
515 alSetError(context
, AL_INVALID_VALUE
);
518 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR
:
519 if(val
>= 0.0f
&& val
<= 10.0f
)
520 effect
->Reverb
.RoomRolloffFactor
= val
;
522 alSetError(context
, AL_INVALID_VALUE
);
526 alSetError(context
, AL_INVALID_ENUM
);
530 static void eaxreverb_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
534 case AL_EAXREVERB_REFLECTIONS_PAN
:
535 if(isfinite(vals
[0]) && isfinite(vals
[1]) && isfinite(vals
[2]))
537 LockContext(context
);
538 effect
->Reverb
.ReflectionsPan
[0] = vals
[0];
539 effect
->Reverb
.ReflectionsPan
[1] = vals
[1];
540 effect
->Reverb
.ReflectionsPan
[2] = vals
[2];
541 UnlockContext(context
);
544 alSetError(context
, AL_INVALID_VALUE
);
546 case AL_EAXREVERB_LATE_REVERB_PAN
:
547 if(isfinite(vals
[0]) && isfinite(vals
[1]) && isfinite(vals
[2]))
549 LockContext(context
);
550 effect
->Reverb
.LateReverbPan
[0] = vals
[0];
551 effect
->Reverb
.LateReverbPan
[1] = vals
[1];
552 effect
->Reverb
.LateReverbPan
[2] = vals
[2];
553 UnlockContext(context
);
556 alSetError(context
, AL_INVALID_VALUE
);
560 eaxreverb_SetParamf(effect
, context
, param
, vals
[0]);
565 static void eaxreverb_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
569 case AL_EAXREVERB_DECAY_HFLIMIT
:
570 *val
= effect
->Reverb
.DecayHFLimit
;
574 alSetError(context
, AL_INVALID_ENUM
);
578 static void eaxreverb_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
580 eaxreverb_GetParami(effect
, context
, param
, vals
);
582 static void eaxreverb_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
586 case AL_EAXREVERB_DENSITY
:
587 *val
= effect
->Reverb
.Density
;
590 case AL_EAXREVERB_DIFFUSION
:
591 *val
= effect
->Reverb
.Diffusion
;
594 case AL_EAXREVERB_GAIN
:
595 *val
= effect
->Reverb
.Gain
;
598 case AL_EAXREVERB_GAINHF
:
599 *val
= effect
->Reverb
.GainHF
;
602 case AL_EAXREVERB_GAINLF
:
603 *val
= effect
->Reverb
.GainLF
;
606 case AL_EAXREVERB_DECAY_TIME
:
607 *val
= effect
->Reverb
.DecayTime
;
610 case AL_EAXREVERB_DECAY_HFRATIO
:
611 *val
= effect
->Reverb
.DecayHFRatio
;
614 case AL_EAXREVERB_DECAY_LFRATIO
:
615 *val
= effect
->Reverb
.DecayLFRatio
;
618 case AL_EAXREVERB_REFLECTIONS_GAIN
:
619 *val
= effect
->Reverb
.ReflectionsGain
;
622 case AL_EAXREVERB_REFLECTIONS_DELAY
:
623 *val
= effect
->Reverb
.ReflectionsDelay
;
626 case AL_EAXREVERB_LATE_REVERB_GAIN
:
627 *val
= effect
->Reverb
.LateReverbGain
;
630 case AL_EAXREVERB_LATE_REVERB_DELAY
:
631 *val
= effect
->Reverb
.LateReverbDelay
;
634 case AL_EAXREVERB_AIR_ABSORPTION_GAINHF
:
635 *val
= effect
->Reverb
.AirAbsorptionGainHF
;
638 case AL_EAXREVERB_ECHO_TIME
:
639 *val
= effect
->Reverb
.EchoTime
;
642 case AL_EAXREVERB_ECHO_DEPTH
:
643 *val
= effect
->Reverb
.EchoDepth
;
646 case AL_EAXREVERB_MODULATION_TIME
:
647 *val
= effect
->Reverb
.ModulationTime
;
650 case AL_EAXREVERB_MODULATION_DEPTH
:
651 *val
= effect
->Reverb
.ModulationDepth
;
654 case AL_EAXREVERB_HFREFERENCE
:
655 *val
= effect
->Reverb
.HFReference
;
658 case AL_EAXREVERB_LFREFERENCE
:
659 *val
= effect
->Reverb
.LFReference
;
662 case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR
:
663 *val
= effect
->Reverb
.RoomRolloffFactor
;
667 alSetError(context
, AL_INVALID_ENUM
);
671 static void eaxreverb_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
675 case AL_EAXREVERB_REFLECTIONS_PAN
:
676 LockContext(context
);
677 vals
[0] = effect
->Reverb
.ReflectionsPan
[0];
678 vals
[1] = effect
->Reverb
.ReflectionsPan
[1];
679 vals
[2] = effect
->Reverb
.ReflectionsPan
[2];
680 UnlockContext(context
);
682 case AL_EAXREVERB_LATE_REVERB_PAN
:
683 LockContext(context
);
684 vals
[0] = effect
->Reverb
.LateReverbPan
[0];
685 vals
[1] = effect
->Reverb
.LateReverbPan
[1];
686 vals
[2] = effect
->Reverb
.LateReverbPan
[2];
687 UnlockContext(context
);
691 eaxreverb_GetParamf(effect
, context
, param
, vals
);
697 static void reverb_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
701 case AL_REVERB_DECAY_HFLIMIT
:
702 if(val
>= AL_REVERB_MIN_DECAY_HFLIMIT
&&
703 val
<= AL_REVERB_MAX_DECAY_HFLIMIT
)
704 effect
->Reverb
.DecayHFLimit
= val
;
706 alSetError(context
, AL_INVALID_VALUE
);
710 alSetError(context
, AL_INVALID_ENUM
);
714 static void reverb_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
716 reverb_SetParami(effect
, context
, param
, vals
[0]);
718 static void reverb_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
722 case AL_REVERB_DENSITY
:
723 if(val
>= AL_REVERB_MIN_DENSITY
&&
724 val
<= AL_REVERB_MAX_DENSITY
)
725 effect
->Reverb
.Density
= val
;
727 alSetError(context
, AL_INVALID_VALUE
);
730 case AL_REVERB_DIFFUSION
:
731 if(val
>= AL_REVERB_MIN_DIFFUSION
&&
732 val
<= AL_REVERB_MAX_DIFFUSION
)
733 effect
->Reverb
.Diffusion
= val
;
735 alSetError(context
, AL_INVALID_VALUE
);
739 if(val
>= AL_REVERB_MIN_GAIN
&&
740 val
<= AL_REVERB_MAX_GAIN
)
741 effect
->Reverb
.Gain
= val
;
743 alSetError(context
, AL_INVALID_VALUE
);
746 case AL_REVERB_GAINHF
:
747 if(val
>= AL_REVERB_MIN_GAINHF
&&
748 val
<= AL_REVERB_MAX_GAINHF
)
749 effect
->Reverb
.GainHF
= val
;
751 alSetError(context
, AL_INVALID_VALUE
);
754 case AL_REVERB_DECAY_TIME
:
755 if(val
>= AL_REVERB_MIN_DECAY_TIME
&&
756 val
<= AL_REVERB_MAX_DECAY_TIME
)
757 effect
->Reverb
.DecayTime
= val
;
759 alSetError(context
, AL_INVALID_VALUE
);
762 case AL_REVERB_DECAY_HFRATIO
:
763 if(val
>= AL_REVERB_MIN_DECAY_HFRATIO
&&
764 val
<= AL_REVERB_MAX_DECAY_HFRATIO
)
765 effect
->Reverb
.DecayHFRatio
= val
;
767 alSetError(context
, AL_INVALID_VALUE
);
770 case AL_REVERB_REFLECTIONS_GAIN
:
771 if(val
>= AL_REVERB_MIN_REFLECTIONS_GAIN
&&
772 val
<= AL_REVERB_MAX_REFLECTIONS_GAIN
)
773 effect
->Reverb
.ReflectionsGain
= val
;
775 alSetError(context
, AL_INVALID_VALUE
);
778 case AL_REVERB_REFLECTIONS_DELAY
:
779 if(val
>= AL_REVERB_MIN_REFLECTIONS_DELAY
&&
780 val
<= AL_REVERB_MAX_REFLECTIONS_DELAY
)
781 effect
->Reverb
.ReflectionsDelay
= val
;
783 alSetError(context
, AL_INVALID_VALUE
);
786 case AL_REVERB_LATE_REVERB_GAIN
:
787 if(val
>= AL_REVERB_MIN_LATE_REVERB_GAIN
&&
788 val
<= AL_REVERB_MAX_LATE_REVERB_GAIN
)
789 effect
->Reverb
.LateReverbGain
= val
;
791 alSetError(context
, AL_INVALID_VALUE
);
794 case AL_REVERB_LATE_REVERB_DELAY
:
795 if(val
>= AL_REVERB_MIN_LATE_REVERB_DELAY
&&
796 val
<= AL_REVERB_MAX_LATE_REVERB_DELAY
)
797 effect
->Reverb
.LateReverbDelay
= val
;
799 alSetError(context
, AL_INVALID_VALUE
);
802 case AL_REVERB_AIR_ABSORPTION_GAINHF
:
803 if(val
>= AL_REVERB_MIN_AIR_ABSORPTION_GAINHF
&&
804 val
<= AL_REVERB_MAX_AIR_ABSORPTION_GAINHF
)
805 effect
->Reverb
.AirAbsorptionGainHF
= val
;
807 alSetError(context
, AL_INVALID_VALUE
);
810 case AL_REVERB_ROOM_ROLLOFF_FACTOR
:
811 if(val
>= AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR
&&
812 val
<= AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR
)
813 effect
->Reverb
.RoomRolloffFactor
= val
;
815 alSetError(context
, AL_INVALID_VALUE
);
819 alSetError(context
, AL_INVALID_ENUM
);
823 static void reverb_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
825 reverb_SetParamf(effect
, context
, param
, vals
[0]);
828 static void reverb_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
832 case AL_REVERB_DECAY_HFLIMIT
:
833 *val
= effect
->Reverb
.DecayHFLimit
;
837 alSetError(context
, AL_INVALID_ENUM
);
841 static void reverb_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
843 reverb_GetParami(effect
, context
, param
, vals
);
845 static void reverb_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
849 case AL_REVERB_DENSITY
:
850 *val
= effect
->Reverb
.Density
;
853 case AL_REVERB_DIFFUSION
:
854 *val
= effect
->Reverb
.Diffusion
;
858 *val
= effect
->Reverb
.Gain
;
861 case AL_REVERB_GAINHF
:
862 *val
= effect
->Reverb
.GainHF
;
865 case AL_REVERB_DECAY_TIME
:
866 *val
= effect
->Reverb
.DecayTime
;
869 case AL_REVERB_DECAY_HFRATIO
:
870 *val
= effect
->Reverb
.DecayHFRatio
;
873 case AL_REVERB_REFLECTIONS_GAIN
:
874 *val
= effect
->Reverb
.ReflectionsGain
;
877 case AL_REVERB_REFLECTIONS_DELAY
:
878 *val
= effect
->Reverb
.ReflectionsDelay
;
881 case AL_REVERB_LATE_REVERB_GAIN
:
882 *val
= effect
->Reverb
.LateReverbGain
;
885 case AL_REVERB_LATE_REVERB_DELAY
:
886 *val
= effect
->Reverb
.LateReverbDelay
;
889 case AL_REVERB_AIR_ABSORPTION_GAINHF
:
890 *val
= effect
->Reverb
.AirAbsorptionGainHF
;
893 case AL_REVERB_ROOM_ROLLOFF_FACTOR
:
894 *val
= effect
->Reverb
.RoomRolloffFactor
;
898 alSetError(context
, AL_INVALID_ENUM
);
902 static void reverb_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
904 reverb_GetParamf(effect
, context
, param
, vals
);
908 static void echo_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
909 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
910 static void echo_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
912 echo_SetParami(effect
, context
, param
, vals
[0]);
914 static void echo_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
919 if(val
>= AL_ECHO_MIN_DELAY
&& val
<= AL_ECHO_MAX_DELAY
)
920 effect
->Echo
.Delay
= val
;
922 alSetError(context
, AL_INVALID_VALUE
);
925 case AL_ECHO_LRDELAY
:
926 if(val
>= AL_ECHO_MIN_LRDELAY
&& val
<= AL_ECHO_MAX_LRDELAY
)
927 effect
->Echo
.LRDelay
= val
;
929 alSetError(context
, AL_INVALID_VALUE
);
932 case AL_ECHO_DAMPING
:
933 if(val
>= AL_ECHO_MIN_DAMPING
&& val
<= AL_ECHO_MAX_DAMPING
)
934 effect
->Echo
.Damping
= val
;
936 alSetError(context
, AL_INVALID_VALUE
);
939 case AL_ECHO_FEEDBACK
:
940 if(val
>= AL_ECHO_MIN_FEEDBACK
&& val
<= AL_ECHO_MAX_FEEDBACK
)
941 effect
->Echo
.Feedback
= val
;
943 alSetError(context
, AL_INVALID_VALUE
);
947 if(val
>= AL_ECHO_MIN_SPREAD
&& val
<= AL_ECHO_MAX_SPREAD
)
948 effect
->Echo
.Spread
= val
;
950 alSetError(context
, AL_INVALID_VALUE
);
954 alSetError(context
, AL_INVALID_ENUM
);
958 static void echo_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
960 echo_SetParamf(effect
, context
, param
, vals
[0]);
963 static void echo_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
964 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
965 static void echo_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
967 echo_GetParami(effect
, context
, param
, vals
);
969 static void echo_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
974 *val
= effect
->Echo
.Delay
;
977 case AL_ECHO_LRDELAY
:
978 *val
= effect
->Echo
.LRDelay
;
981 case AL_ECHO_DAMPING
:
982 *val
= effect
->Echo
.Damping
;
985 case AL_ECHO_FEEDBACK
:
986 *val
= effect
->Echo
.Feedback
;
990 *val
= effect
->Echo
.Spread
;
994 alSetError(context
, AL_INVALID_ENUM
);
998 static void echo_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
1000 echo_GetParamf(effect
, context
, param
, vals
);
1004 static void mod_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
1008 case AL_RING_MODULATOR_FREQUENCY
:
1009 if(val
>= AL_RING_MODULATOR_MIN_FREQUENCY
&&
1010 val
<= AL_RING_MODULATOR_MAX_FREQUENCY
)
1011 effect
->Modulator
.Frequency
= val
;
1013 alSetError(context
, AL_INVALID_VALUE
);
1016 case AL_RING_MODULATOR_HIGHPASS_CUTOFF
:
1017 if(val
>= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF
&&
1018 val
<= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF
)
1019 effect
->Modulator
.HighPassCutoff
= val
;
1021 alSetError(context
, AL_INVALID_VALUE
);
1025 alSetError(context
, AL_INVALID_ENUM
);
1029 static void mod_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
1031 mod_SetParamf(effect
, context
, param
, vals
[0]);
1033 static void mod_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
1037 case AL_RING_MODULATOR_FREQUENCY
:
1038 case AL_RING_MODULATOR_HIGHPASS_CUTOFF
:
1039 mod_SetParamf(effect
, context
, param
, (ALfloat
)val
);
1042 case AL_RING_MODULATOR_WAVEFORM
:
1043 if(val
>= AL_RING_MODULATOR_MIN_WAVEFORM
&&
1044 val
<= AL_RING_MODULATOR_MAX_WAVEFORM
)
1045 effect
->Modulator
.Waveform
= val
;
1047 alSetError(context
, AL_INVALID_VALUE
);
1051 alSetError(context
, AL_INVALID_ENUM
);
1055 static void mod_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
1057 mod_SetParami(effect
, context
, param
, vals
[0]);
1060 static void mod_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
1064 case AL_RING_MODULATOR_FREQUENCY
:
1065 *val
= (ALint
)effect
->Modulator
.Frequency
;
1067 case AL_RING_MODULATOR_HIGHPASS_CUTOFF
:
1068 *val
= (ALint
)effect
->Modulator
.HighPassCutoff
;
1070 case AL_RING_MODULATOR_WAVEFORM
:
1071 *val
= effect
->Modulator
.Waveform
;
1075 alSetError(context
, AL_INVALID_ENUM
);
1079 static void mod_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
1081 mod_GetParami(effect
, context
, param
, vals
);
1083 static void mod_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
1087 case AL_RING_MODULATOR_FREQUENCY
:
1088 *val
= effect
->Modulator
.Frequency
;
1090 case AL_RING_MODULATOR_HIGHPASS_CUTOFF
:
1091 *val
= effect
->Modulator
.HighPassCutoff
;
1095 alSetError(context
, AL_INVALID_ENUM
);
1099 static void mod_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
1101 mod_GetParamf(effect
, context
, param
, vals
);
1105 static void ded_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
1106 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1107 static void ded_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
1109 ded_SetParami(effect
, context
, param
, vals
[0]);
1111 static void ded_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
1115 case AL_DEDICATED_GAIN
:
1116 if(val
>= 0.0f
&& isfinite(val
))
1117 effect
->Dedicated
.Gain
= val
;
1119 alSetError(context
, AL_INVALID_VALUE
);
1123 alSetError(context
, AL_INVALID_ENUM
);
1127 static void ded_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
1129 ded_SetParamf(effect
, context
, param
, vals
[0]);
1132 static void ded_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
1133 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1134 static void ded_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
1136 ded_GetParami(effect
, context
, param
, vals
);
1138 static void ded_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
1142 case AL_DEDICATED_GAIN
:
1143 *val
= effect
->Dedicated
.Gain
;
1147 alSetError(context
, AL_INVALID_ENUM
);
1151 static void ded_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
1153 ded_GetParamf(effect
, context
, param
, vals
);
1157 static void null_SetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint val
)
1158 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1159 static void null_SetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALint
*vals
)
1160 { (void)effect
;(void)param
;(void)vals
; alSetError(context
, AL_INVALID_ENUM
); }
1161 static void null_SetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat val
)
1162 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1163 static void null_SetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, const ALfloat
*vals
)
1164 { (void)effect
;(void)param
;(void)vals
; alSetError(context
, AL_INVALID_ENUM
); }
1166 static void null_GetParami(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*val
)
1167 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1168 static void null_GetParamiv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALint
*vals
)
1169 { (void)effect
;(void)param
;(void)vals
; alSetError(context
, AL_INVALID_ENUM
); }
1170 static void null_GetParamf(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*val
)
1171 { (void)effect
;(void)param
;(void)val
; alSetError(context
, AL_INVALID_ENUM
); }
1172 static void null_GetParamfv(ALeffect
*effect
, ALCcontext
*context
, ALenum param
, ALfloat
*vals
)
1173 { (void)effect
;(void)param
;(void)vals
; alSetError(context
, AL_INVALID_ENUM
); }
1176 ALvoid
ReleaseALEffects(ALCdevice
*device
)
1179 for(i
= 0;i
< device
->EffectMap
.size
;i
++)
1181 ALeffect
*temp
= device
->EffectMap
.array
[i
].value
;
1182 device
->EffectMap
.array
[i
].value
= NULL
;
1184 // Release effect structure
1185 FreeThunkEntry(temp
->effect
);
1186 memset(temp
, 0, sizeof(ALeffect
));
1192 static void InitEffectParams(ALeffect
*effect
, ALenum type
)
1196 case AL_EFFECT_EAXREVERB
:
1197 effect
->Reverb
.Density
= AL_EAXREVERB_DEFAULT_DENSITY
;
1198 effect
->Reverb
.Diffusion
= AL_EAXREVERB_DEFAULT_DIFFUSION
;
1199 effect
->Reverb
.Gain
= AL_EAXREVERB_DEFAULT_GAIN
;
1200 effect
->Reverb
.GainHF
= AL_EAXREVERB_DEFAULT_GAINHF
;
1201 effect
->Reverb
.GainLF
= AL_EAXREVERB_DEFAULT_GAINLF
;
1202 effect
->Reverb
.DecayTime
= AL_EAXREVERB_DEFAULT_DECAY_TIME
;
1203 effect
->Reverb
.DecayHFRatio
= AL_EAXREVERB_DEFAULT_DECAY_HFRATIO
;
1204 effect
->Reverb
.DecayLFRatio
= AL_EAXREVERB_DEFAULT_DECAY_LFRATIO
;
1205 effect
->Reverb
.ReflectionsGain
= AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN
;
1206 effect
->Reverb
.ReflectionsDelay
= AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY
;
1207 effect
->Reverb
.ReflectionsPan
[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
1208 effect
->Reverb
.ReflectionsPan
[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
1209 effect
->Reverb
.ReflectionsPan
[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ
;
1210 effect
->Reverb
.LateReverbGain
= AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN
;
1211 effect
->Reverb
.LateReverbDelay
= AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY
;
1212 effect
->Reverb
.LateReverbPan
[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
1213 effect
->Reverb
.LateReverbPan
[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
1214 effect
->Reverb
.LateReverbPan
[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ
;
1215 effect
->Reverb
.EchoTime
= AL_EAXREVERB_DEFAULT_ECHO_TIME
;
1216 effect
->Reverb
.EchoDepth
= AL_EAXREVERB_DEFAULT_ECHO_DEPTH
;
1217 effect
->Reverb
.ModulationTime
= AL_EAXREVERB_DEFAULT_MODULATION_TIME
;
1218 effect
->Reverb
.ModulationDepth
= AL_EAXREVERB_DEFAULT_MODULATION_DEPTH
;
1219 effect
->Reverb
.AirAbsorptionGainHF
= AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
1220 effect
->Reverb
.HFReference
= AL_EAXREVERB_DEFAULT_HFREFERENCE
;
1221 effect
->Reverb
.LFReference
= AL_EAXREVERB_DEFAULT_LFREFERENCE
;
1222 effect
->Reverb
.RoomRolloffFactor
= AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
1223 effect
->Reverb
.DecayHFLimit
= AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT
;
1224 effect
->SetParami
= eaxreverb_SetParami
;
1225 effect
->SetParamiv
= eaxreverb_SetParamiv
;
1226 effect
->SetParamf
= eaxreverb_SetParamf
;
1227 effect
->SetParamfv
= eaxreverb_SetParamfv
;
1228 effect
->GetParami
= eaxreverb_GetParami
;
1229 effect
->GetParamiv
= eaxreverb_GetParamiv
;
1230 effect
->GetParamf
= eaxreverb_GetParamf
;
1231 effect
->GetParamfv
= eaxreverb_GetParamfv
;
1233 case AL_EFFECT_REVERB
:
1234 effect
->Reverb
.Density
= AL_REVERB_DEFAULT_DENSITY
;
1235 effect
->Reverb
.Diffusion
= AL_REVERB_DEFAULT_DIFFUSION
;
1236 effect
->Reverb
.Gain
= AL_REVERB_DEFAULT_GAIN
;
1237 effect
->Reverb
.GainHF
= AL_REVERB_DEFAULT_GAINHF
;
1238 effect
->Reverb
.DecayTime
= AL_REVERB_DEFAULT_DECAY_TIME
;
1239 effect
->Reverb
.DecayHFRatio
= AL_REVERB_DEFAULT_DECAY_HFRATIO
;
1240 effect
->Reverb
.ReflectionsGain
= AL_REVERB_DEFAULT_REFLECTIONS_GAIN
;
1241 effect
->Reverb
.ReflectionsDelay
= AL_REVERB_DEFAULT_REFLECTIONS_DELAY
;
1242 effect
->Reverb
.LateReverbGain
= AL_REVERB_DEFAULT_LATE_REVERB_GAIN
;
1243 effect
->Reverb
.LateReverbDelay
= AL_REVERB_DEFAULT_LATE_REVERB_DELAY
;
1244 effect
->Reverb
.AirAbsorptionGainHF
= AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF
;
1245 effect
->Reverb
.RoomRolloffFactor
= AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR
;
1246 effect
->Reverb
.DecayHFLimit
= AL_REVERB_DEFAULT_DECAY_HFLIMIT
;
1247 effect
->SetParami
= reverb_SetParami
;
1248 effect
->SetParamiv
= reverb_SetParamiv
;
1249 effect
->SetParamf
= reverb_SetParamf
;
1250 effect
->SetParamfv
= reverb_SetParamfv
;
1251 effect
->GetParami
= reverb_GetParami
;
1252 effect
->GetParamiv
= reverb_GetParamiv
;
1253 effect
->GetParamf
= reverb_GetParamf
;
1254 effect
->GetParamfv
= reverb_GetParamfv
;
1256 case AL_EFFECT_ECHO
:
1257 effect
->Echo
.Delay
= AL_ECHO_DEFAULT_DELAY
;
1258 effect
->Echo
.LRDelay
= AL_ECHO_DEFAULT_LRDELAY
;
1259 effect
->Echo
.Damping
= AL_ECHO_DEFAULT_DAMPING
;
1260 effect
->Echo
.Feedback
= AL_ECHO_DEFAULT_FEEDBACK
;
1261 effect
->Echo
.Spread
= AL_ECHO_DEFAULT_SPREAD
;
1262 effect
->SetParami
= echo_SetParami
;
1263 effect
->SetParamiv
= echo_SetParamiv
;
1264 effect
->SetParamf
= echo_SetParamf
;
1265 effect
->SetParamfv
= echo_SetParamfv
;
1266 effect
->GetParami
= echo_GetParami
;
1267 effect
->GetParamiv
= echo_GetParamiv
;
1268 effect
->GetParamf
= echo_GetParamf
;
1269 effect
->GetParamfv
= echo_GetParamfv
;
1271 case AL_EFFECT_RING_MODULATOR
:
1272 effect
->Modulator
.Frequency
= AL_RING_MODULATOR_DEFAULT_FREQUENCY
;
1273 effect
->Modulator
.HighPassCutoff
= AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF
;
1274 effect
->Modulator
.Waveform
= AL_RING_MODULATOR_DEFAULT_WAVEFORM
;
1275 effect
->SetParami
= mod_SetParami
;
1276 effect
->SetParamiv
= mod_SetParamiv
;
1277 effect
->SetParamf
= mod_SetParamf
;
1278 effect
->SetParamfv
= mod_SetParamfv
;
1279 effect
->GetParami
= mod_GetParami
;
1280 effect
->GetParamiv
= mod_GetParamiv
;
1281 effect
->GetParamf
= mod_GetParamf
;
1282 effect
->GetParamfv
= mod_GetParamfv
;
1284 case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT
:
1285 case AL_EFFECT_DEDICATED_DIALOGUE
:
1286 effect
->Dedicated
.Gain
= 1.0f
;
1287 effect
->SetParami
= ded_SetParami
;
1288 effect
->SetParamiv
= ded_SetParamiv
;
1289 effect
->SetParamf
= ded_SetParamf
;
1290 effect
->SetParamfv
= ded_SetParamfv
;
1291 effect
->GetParami
= ded_GetParami
;
1292 effect
->GetParamiv
= ded_GetParamiv
;
1293 effect
->GetParamf
= ded_GetParamf
;
1294 effect
->GetParamfv
= ded_GetParamfv
;
1297 effect
->SetParami
= null_SetParami
;
1298 effect
->SetParamiv
= null_SetParamiv
;
1299 effect
->SetParamf
= null_SetParamf
;
1300 effect
->SetParamfv
= null_SetParamfv
;
1301 effect
->GetParami
= null_GetParami
;
1302 effect
->GetParamiv
= null_GetParamiv
;
1303 effect
->GetParamf
= null_GetParamf
;
1304 effect
->GetParamfv
= null_GetParamfv
;
1307 effect
->type
= type
;