aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/SoundSystem.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-29 16:15:49 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-29 16:15:49 +0200
commitfeea4cbb648d67e46b413880ddbf203c88c2a2b1 (patch)
tree7c3b6bfddfef49e42b7f64256e3c027c43744f8e /src/crepe/SoundSystem.cpp
parent3cb7227c3c9678141ff74915331b706265c380cb (diff)
implement debug logging functions and fix sound system segfault
Diffstat (limited to 'src/crepe/SoundSystem.cpp')
-rw-r--r--src/crepe/SoundSystem.cpp11
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();
}