mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 22:23:43 +00:00
Compare commits
No commits in common. "e215fbd5b67f44957d85be11ec5f9ac9a0ff0f36" and "9bb9d0fbcc4221750eae3115ae4b8ac9be6e1c97" have entirely different histories.
e215fbd5b6
...
9bb9d0fbcc
@ -23,12 +23,7 @@ class SoundManager
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
SoundManager() {
|
SoundManager() {
|
||||||
if (this_instance == nullptr) {
|
this_instance = this;
|
||||||
this_instance = this;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw std::runtime_error("SoundManager instance already exists!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
~SoundManager() {
|
~SoundManager() {
|
||||||
for (auto& it : this->sound_cache) {
|
for (auto& it : this->sound_cache) {
|
||||||
@ -86,10 +81,6 @@ class SoundManager
|
|||||||
static void addSingleBackgroundMusic(BackgroundMusic backgroundMusic, const char* path);
|
static void addSingleBackgroundMusic(BackgroundMusic backgroundMusic, const char* path);
|
||||||
static void addBackgroundMusic(const std::map<BackgroundMusic, const char*> &backgroundMusic);
|
static void addBackgroundMusic(const std::map<BackgroundMusic, const char*> &backgroundMusic);
|
||||||
|
|
||||||
static SoundManager* getInstance() {
|
|
||||||
return this_instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@ -185,8 +185,6 @@ void SoundManager::addBackgroundMusic(const std::map<BackgroundMusic, const char
|
|||||||
addSingleBackgroundMusic(track.first, track.second);
|
addSingleBackgroundMusic(track.first, track.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundManager* SoundManager::this_instance = nullptr;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user