aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/winmm.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-27 13:40:43 -0800
committerChris Robinson <[email protected]>2018-12-27 13:40:43 -0800
commit4782d6107d250e3528c5e567dca48da727584ee7 (patch)
tree05679c4196c4dacfce65991fa4caa7862cf1c381 /Alc/backends/winmm.cpp
parent7880f27054cd69cd1e36ebd3d20aa9d6148e3bbd (diff)
Use a proper constructor/destructor for the ALCbackend base
Diffstat (limited to 'Alc/backends/winmm.cpp')
-rw-r--r--Alc/backends/winmm.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp
index 485586f6..ab638cd4 100644
--- a/Alc/backends/winmm.cpp
+++ b/Alc/backends/winmm.cpp
@@ -132,6 +132,8 @@ struct ALCwinmmPlayback final : public ALCbackend {
std::atomic<ALenum> mKillNow{AL_TRUE};
std::thread mThread;
+
+ ALCwinmmPlayback(ALCdevice *device) noexcept : ALCbackend{device} { }
};
void ALCwinmmPlayback_Construct(ALCwinmmPlayback *self, ALCdevice *device);
@@ -156,8 +158,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCwinmmPlayback);
void ALCwinmmPlayback_Construct(ALCwinmmPlayback *self, ALCdevice *device)
{
- new (self) ALCwinmmPlayback{};
- ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ new (self) ALCwinmmPlayback{device};
SET_VTABLE2(ALCwinmmPlayback, ALCbackend, self);
std::fill(self->WaveBuffer.begin(), self->WaveBuffer.end(), WAVEHDR{});
@@ -172,7 +173,6 @@ void ALCwinmmPlayback_Destruct(ALCwinmmPlayback *self)
al_free(self->WaveBuffer[0].lpData);
std::fill(self->WaveBuffer.begin(), self->WaveBuffer.end(), WAVEHDR{});
- ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~ALCwinmmPlayback();
}
@@ -407,6 +407,8 @@ struct ALCwinmmCapture final : public ALCbackend {
std::atomic<ALenum> mKillNow{AL_TRUE};
std::thread mThread;
+
+ ALCwinmmCapture(ALCdevice *device) noexcept : ALCbackend{device} { }
};
void ALCwinmmCapture_Construct(ALCwinmmCapture *self, ALCdevice *device);
@@ -431,8 +433,7 @@ DEFINE_ALCBACKEND_VTABLE(ALCwinmmCapture);
void ALCwinmmCapture_Construct(ALCwinmmCapture *self, ALCdevice *device)
{
- new (self) ALCwinmmCapture{};
- ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device);
+ new (self) ALCwinmmCapture{device};
SET_VTABLE2(ALCwinmmCapture, ALCbackend, self);
std::fill(self->WaveBuffer.begin(), self->WaveBuffer.end(), WAVEHDR{});
@@ -448,7 +449,6 @@ void ALCwinmmCapture_Destruct(ALCwinmmCapture *self)
al_free(self->WaveBuffer[0].lpData);
std::fill(self->WaveBuffer.begin(), self->WaveBuffer.end(), WAVEHDR{});
- ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));
self->~ALCwinmmCapture();
}