diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2018-12-27 13:40:43 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2018-12-27 13:40:43 -0800 |
commit | 4782d6107d250e3528c5e567dca48da727584ee7 (patch) | |
tree | 05679c4196c4dacfce65991fa4caa7862cf1c381 /Alc/backends/dsound.cpp | |
parent | 7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff) |
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/dsound.cpp')
-rw-r--r-- | Alc/backends/dsound.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 19fe8053..7bfe79df 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -193,6 +193,8 @@ struct ALCdsoundPlayback final : public ALCbackend { std::atomic<ALenum> mKillNow{AL_TRUE}; std::thread mThread; + + ALCdsoundPlayback(ALCdevice *device) noexcept : ALCbackend{device} { } }; int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self); @@ -215,8 +217,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCdsoundPlayback); void ALCdsoundPlayback_Construct(ALCdsoundPlayback *self, ALCdevice *device) { - new (self) ALCdsoundPlayback{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCdsoundPlayback{device}; SET_VTABLE2(ALCdsoundPlayback, ALCbackend, self); } @@ -239,7 +240,6 @@ void ALCdsoundPlayback_Destruct(ALCdsoundPlayback *self) CloseHandle(self->mNotifyEvent); self->mNotifyEvent = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCdsoundPlayback(); } @@ -656,6 +656,8 @@ struct ALCdsoundCapture final : public ALCbackend { DWORD mCursor{0u}; RingBufferPtr mRing; + + ALCdsoundCapture(ALCdevice *device) noexcept : ALCbackend{device} { } }; void ALCdsoundCapture_Construct(ALCdsoundCapture *self, ALCdevice *device); @@ -674,8 +676,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCdsoundCapture); void ALCdsoundCapture_Construct(ALCdsoundCapture *self, ALCdevice *device) { - new (self) ALCdsoundCapture{}; - ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); + new (self) ALCdsoundCapture{device}; SET_VTABLE2(ALCdsoundCapture, ALCbackend, self); } @@ -692,7 +693,6 @@ void ALCdsoundCapture_Destruct(ALCdsoundCapture *self) self->mDSC->Release(); self->mDSC = nullptr; - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); self->~ALCdsoundCapture(); } |