diff options
author | Chris Robinson <[email protected]> | 2013-05-21 04:18:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-21 04:18:02 -0700 |
commit | 5516d8df0b21722c96189b946a8a10e9cbb0c001 (patch) | |
tree | c35fb0bf09965f0d528d40e984e529f3b8f3bac8 /Alc/alcDedicated.c | |
parent | fba9ac6db1d1d1bff066befe48f75c64aead3587 (diff) |
Use macros to help define vtables for effect states
Diffstat (limited to 'Alc/alcDedicated.c')
-rw-r--r-- | Alc/alcDedicated.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c index 35de345f..a3267509 100644 --- a/Alc/alcDedicated.c +++ b/Alc/alcDedicated.c @@ -36,20 +36,20 @@ typedef struct ALdedicatedState { } ALdedicatedState; -static ALvoid DedicatedDestroy(ALeffectState *effect) +static ALvoid ALdedicatedState_Destroy(ALeffectState *effect) { ALdedicatedState *state = STATIC_UPCAST(ALdedicatedState, ALeffectState, effect); free(state); } -static ALboolean DedicatedDeviceUpdate(ALeffectState *effect, ALCdevice *Device) +static ALboolean ALdedicatedState_DeviceUpdate(ALeffectState *effect, ALCdevice *Device) { (void)effect; (void)Device; return AL_TRUE; } -static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const ALeffectslot *Slot) +static ALvoid ALdedicatedState_Update(ALeffectState *effect, ALCdevice *device, const ALeffectslot *Slot) { ALdedicatedState *state = STATIC_UPCAST(ALdedicatedState, ALeffectState, effect); ALfloat Gain; @@ -65,7 +65,7 @@ static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const AL state->gains[LFE] = Gain; } -static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) +static ALvoid ALdedicatedState_Process(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) { ALdedicatedState *state = STATIC_UPCAST(ALdedicatedState, ALeffectState, effect); const ALfloat *gains = state->gains; @@ -81,19 +81,16 @@ static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const } } +DEFINE_ALEFFECTSTATE_VTABLE(ALdedicatedState); + ALeffectState *DedicatedCreate(void) { ALdedicatedState *state; ALsizei s; state = malloc(sizeof(*state)); - if(!state) - return NULL; - - STATIC_CAST(ALeffectState, state)->Destroy = DedicatedDestroy; - STATIC_CAST(ALeffectState, state)->DeviceUpdate = DedicatedDeviceUpdate; - STATIC_CAST(ALeffectState, state)->Update = DedicatedUpdate; - STATIC_CAST(ALeffectState, state)->Process = DedicatedProcess; + if(!state) return NULL; + SET_VTABLE2(ALdedicatedState, ALeffectState, state); for(s = 0;s < MaxChannels;s++) state->gains[s] = 0.0f; |