aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h8
-rw-r--r--OpenAL32/alAuxEffectSlot.c4
2 files changed, 5 insertions, 7 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h
index d496df8d..60724654 100644
--- a/OpenAL32/Include/alAuxEffectSlot.h
+++ b/OpenAL32/Include/alAuxEffectSlot.h
@@ -48,18 +48,16 @@ static const struct ALeffectStateVtable T##_ALeffectState_vtable = { \
struct ALeffectStateFactoryVtable {
- ALeffectState *(*const create)(void);
+ ALeffectState *(*const create)(ALeffectStateFactory *factory);
};
struct ALeffectStateFactory {
const struct ALeffectStateFactoryVtable *vtbl;
};
-#define ALeffectStateFactory_create(p) ((p)->vtbl->create())
-
#define DEFINE_ALEFFECTSTATEFACTORY_VTABLE(T) \
-static ALeffectState* T##_ALeffectStateFactory_create(void) \
-{ return T##_create(); } \
+static ALeffectState* T##_ALeffectStateFactory_create(ALeffectStateFactory *factory) \
+{ return T##_create(STATIC_UPCAST(T, ALeffectStateFactory, factory)); } \
\
static const struct ALeffectStateFactoryVtable T##_ALeffectStateFactory_vtable = { \
T##_ALeffectStateFactory_create, \
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 14dd8816..878597d9 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -486,7 +486,7 @@ ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *e
ERR("Failed to find factory for effect type 0x%04x\n", newtype);
return AL_INVALID_ENUM;
}
- State = ALeffectStateFactory_create(factory);
+ State = VCALL_NOARGS(factory,create);
if(!State)
return AL_OUT_OF_MEMORY;
@@ -548,7 +548,7 @@ ALenum InitEffectSlot(ALeffectslot *slot)
slot->EffectType = AL_EFFECT_NULL;
factory = getFactoryByType(AL_EFFECT_NULL);
- if(!(slot->EffectState=ALeffectStateFactory_create(factory)))
+ if(!(slot->EffectState=VCALL_NOARGS(factory,create)))
return AL_OUT_OF_MEMORY;
slot->Gain = 1.0;