mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +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 "Settings.h"
|
||||
|
||||
#include <SDL.h>
|
||||
#include "Log.h"
|
||||
|
@ -62,7 +63,7 @@ AudioManager::~AudioManager()
|
|||
std::shared_ptr<AudioManager> & AudioManager::getInstance()
|
||||
{
|
||||
//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);
|
||||
}
|
||||
return sInstance;
|
||||
|
|
Loading…
Reference in a new issue