diff options
Diffstat (limited to 'src/crepe/SoundSystem.cpp')
-rw-r--r-- | src/crepe/SoundSystem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/crepe/SoundSystem.cpp b/src/crepe/SoundSystem.cpp index 30b0157..29bd196 100644 --- a/src/crepe/SoundSystem.cpp +++ b/src/crepe/SoundSystem.cpp @@ -1,9 +1,14 @@ +#include "util/log.h" + #include "SoundSystem.h" #include <memory> using namespace crepe; -SoundSystem SoundSystem::instance { }; +SoundSystem & SoundSystem::instance() { + static SoundSystem instance; + return instance; +} std::unique_ptr<Sound> SoundSystem::sound(const std::string & src) { auto res = std::make_unique<api::Resource>(src); @@ -11,15 +16,17 @@ std::unique_ptr<Sound> SoundSystem::sound(const std::string & src) { } std::unique_ptr<Sound> SoundSystem::sound(std::unique_ptr<api::Resource> res) { - Sound * out = new Sound(std::move(res), SoundSystem::instance); + Sound * out = new Sound(std::move(res)); return std::unique_ptr<Sound>(out); } SoundSystem::SoundSystem() { + dbg_trace(); engine.init(); } SoundSystem::~SoundSystem() { + dbg_trace(); engine.deinit(); } |