diff options
author | Chris Robinson <[email protected]> | 2018-11-19 06:43:37 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-19 06:43:37 -0800 |
commit | c5c537cc5f5cb466cdf6679c9af9768301e32cc3 (patch) | |
tree | 6e9252e69132430c35e853132df5e42f5c1fae4d /Alc/effects/null.cpp | |
parent | f0cc34a60e65b7120a8d2d2bd5f76aebb3352685 (diff) |
Use proper inheritence for EffectStateFactory
Diffstat (limited to 'Alc/effects/null.cpp')
-rw-r--r-- | Alc/effects/null.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Alc/effects/null.cpp b/Alc/effects/null.cpp index 0d85d505..f5641e20 100644 --- a/Alc/effects/null.cpp +++ b/Alc/effects/null.cpp @@ -89,33 +89,21 @@ static void ALnullState_Delete(void *ptr) struct NullStateFactory final : public EffectStateFactory { - NullStateFactory() noexcept; + ALeffectState *create() override; }; /* Creates ALeffectState objects of the appropriate type. */ -ALeffectState *NullStateFactory_create(NullStateFactory *UNUSED(factory)) +ALeffectState *NullStateFactory::create() { ALnullState *state; - NEW_OBJ0(state, ALnullState)(); - if(!state) return NULL; - - return STATIC_CAST(ALeffectState, state); + return state; } -/* Define the EffectStateFactory vtable for this type. */ -DEFINE_EFFECTSTATEFACTORY_VTABLE(NullStateFactory); - -NullStateFactory::NullStateFactory() noexcept - : EffectStateFactory{GET_VTABLE2(NullStateFactory, EffectStateFactory)} -{ -} - - EffectStateFactory *NullStateFactory_getFactory(void) { static NullStateFactory NullFactory{}; - return STATIC_CAST(EffectStateFactory, &NullFactory); + return &NullFactory; } |