mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Rework internal module registration to happen in constructors.
This commit is contained in:
@@ -106,7 +106,8 @@ static const char *getDeviceSpecifier(ALCdevice *device)
|
||||
}
|
||||
|
||||
Audio::Audio()
|
||||
: device(nullptr)
|
||||
: love::audio::Audio("love.audio.openal")
|
||||
, device(nullptr)
|
||||
, context(nullptr)
|
||||
, pool(nullptr)
|
||||
, poolThread(nullptr)
|
||||
@@ -256,11 +257,6 @@ Audio::~Audio()
|
||||
alcCloseDevice(device);
|
||||
}
|
||||
|
||||
const char *Audio::getName() const
|
||||
{
|
||||
return "love.audio.openal";
|
||||
}
|
||||
|
||||
love::audio::Source *Audio::newSource(love::sound::Decoder *decoder)
|
||||
{
|
||||
return new Source(pool, decoder);
|
||||
|
||||
@@ -78,9 +78,6 @@ public:
|
||||
**/
|
||||
static ALenum getFormat(int bitDepth, int channels);
|
||||
|
||||
// Implements Module.
|
||||
const char *getName() const;
|
||||
|
||||
// Implements Audio.
|
||||
love::audio::Source *newSource(love::sound::Decoder *decoder);
|
||||
love::audio::Source *newSource(love::sound::SoundData *soundData);
|
||||
|
||||
Reference in New Issue
Block a user