summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 913b55656..25b37d578 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -69,6 +69,8 @@ Sound::~Sound()
config.removeListener("playBattleSound", this);
config.removeListener("playGuiSound", this);
config.removeListener("playMusic", this);
+ config.removeListener("sfxVolume", this);
+ config.removeListener("musicVolume", this);
// Unlink the callback function.
Mix_HookMusicFinished(nullptr);
@@ -82,6 +84,10 @@ void Sound::optionChanged(const std::string &value)
mPlayGui = config.getBoolValue("playGuiSound");
else if (value == "playMusic")
mPlayMusic = config.getBoolValue("playMusic");
+ else if (value == "sfxVolume")
+ setSfxVolume(config.getIntValue("sfxVolume"));
+ else if (value == "musicVolume")
+ setMusicVolume(config.getIntValue("musicVolume"));
}
void Sound::init()
@@ -98,6 +104,8 @@ void Sound::init()
config.addListener("playBattleSound", this);
config.addListener("playGuiSound", this);
config.addListener("playMusic", this);
+ config.addListener("sfxVolume", this);
+ config.addListener("musicVolume", this);
if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1)
{