aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-21 04:18:02 -0700
committerChris Robinson <[email protected]>2013-05-21 04:18:02 -0700
commit5516d8df0b21722c96189b946a8a10e9cbb0c001 (patch)
treec35fb0bf09965f0d528d40e984e529f3b8f3bac8 /OpenAL32/alAuxEffectSlot.c
parentfba9ac6db1d1d1bff066befe48f75c64aead3587 (diff)
Use macros to help define vtables for effect states
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 7df6bca4..0932376d 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -393,41 +393,43 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
}
-static ALvoid NoneDestroy(ALeffectState *State)
-{ free(State); }
-static ALboolean NoneDeviceUpdate(ALeffectState *State, ALCdevice *Device)
+typedef struct ALnoneState {
+ DERIVE_FROM_TYPE(ALeffectState);
+} ALnoneState;
+
+static ALvoid ALnoneState_Destroy(ALeffectState *state)
+{ free(state); }
+static ALboolean ALnoneState_DeviceUpdate(ALeffectState *state, ALCdevice *device)
{
return AL_TRUE;
- (void)State;
- (void)Device;
+ (void)state;
+ (void)device;
}
-static ALvoid NoneUpdate(ALeffectState *State, ALCdevice *Device, const ALeffectslot *Slot)
+static ALvoid ALnoneState_Update(ALeffectState *state, ALCdevice *device, const ALeffectslot *slot)
{
- (void)State;
- (void)Device;
- (void)Slot;
+ (void)state;
+ (void)device;
+ (void)slot;
}
-static ALvoid NoneProcess(ALeffectState *State, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
+static ALvoid ALnoneState_Process(ALeffectState *state, ALuint samplesToDo, const ALfloat *RESTRICT samplesIn, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE])
{
- (void)State;
- (void)SamplesToDo;
- (void)SamplesIn;
- (void)SamplesOut;
+ (void)state;
+ (void)samplesToDo;
+ (void)samplesIn;
+ (void)samplesOut;
}
+
+DEFINE_ALEFFECTSTATE_VTABLE(ALnoneState);
+
ALeffectState *NoneCreate(void)
{
- ALeffectState *state;
+ ALnoneState *state;
state = calloc(1, sizeof(*state));
- if(!state)
- return NULL;
-
- state->Destroy = NoneDestroy;
- state->DeviceUpdate = NoneDeviceUpdate;
- state->Update = NoneUpdate;
- state->Process = NoneProcess;
+ if(!state) return NULL;
+ SET_VTABLE2(ALnoneState, ALeffectState, state);
- return state;
+ return STATIC_CAST(ALeffectState, state);
}
void null_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)