Rework internal module registration to happen in constructors.

This commit is contained in:
Sasha Szpakowski
2024-02-24 15:21:38 -04:00
parent c7e4dafd88
commit 1e97e09b28
73 changed files with 154 additions and 248 deletions
+5
View File
@@ -27,6 +27,11 @@ namespace sound
love::Type Sound::type("Sound", &Module::type);
Sound::Sound(const char *name)
: Module(M_SOUND, name)
{
}
Sound::~Sound()
{
}
+4 -3
View File
@@ -46,9 +46,6 @@ public:
virtual ~Sound();
// Implements Module.
virtual ModuleType getModuleType() const { return M_SOUND; }
/**
* Creates new SoundData from a decoder. Fully expands the
* encoded sound data into raw sound data. Not recommended
@@ -89,6 +86,10 @@ public:
**/
virtual Decoder *newDecoder(Stream *stream, int bufferSize) = 0;
protected:
Sound(const char *name);
}; // Sound
} // sound
+1 -5
View File
@@ -59,6 +59,7 @@ namespace lullaby
{
Sound::Sound()
: love::sound::Sound("love.sound.lullaby")
{
}
@@ -66,11 +67,6 @@ Sound::~Sound()
{
}
const char *Sound::getName() const
{
return "love.sound.lullaby";
}
sound::Decoder *Sound::newDecoder(Stream *stream, int bufferSize)
{
std::vector<DecoderImpl> possibleDecoders = {
-3
View File
@@ -48,9 +48,6 @@ public:
Sound();
virtual ~Sound();
/// @copydoc love::Module::getName
const char *getName() const override;
/// @copydoc love::sound::Sound::newDecoder
sound::Decoder *newDecoder(Stream *stream, int bufferSize) override;