mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
AudioManager: don't initialize when unnecessary
If navigation sounds are disabled, don't initialize AudioManager unnecessarily.
This commit is contained in:
parent
35abc91d30
commit
98c170f829
|
@ -1,4 +1,5 @@
|
||||||
#include "AudioManager.h"
|
#include "AudioManager.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
@ -62,7 +63,7 @@ AudioManager::~AudioManager()
|
||||||
std::shared_ptr<AudioManager> & AudioManager::getInstance()
|
std::shared_ptr<AudioManager> & AudioManager::getInstance()
|
||||||
{
|
{
|
||||||
//check if an AudioManager instance is already created, if not create one
|
//check if an AudioManager instance is already created, if not create one
|
||||||
if (sInstance == nullptr) {
|
if (sInstance == nullptr && Settings::getInstance()->getBool("EnableSounds")) {
|
||||||
sInstance = std::shared_ptr<AudioManager>(new AudioManager);
|
sInstance = std::shared_ptr<AudioManager>(new AudioManager);
|
||||||
}
|
}
|
||||||
return sInstance;
|
return sInstance;
|
||||||
|
|
Loading…
Reference in a new issue