Commit f788c0d4 authored by nekrozar's avatar nekrozar

fix sound volume

parent d0abf558
...@@ -49,6 +49,7 @@ void SoundManager::PlaySoundEffect(int sound) { ...@@ -49,6 +49,7 @@ void SoundManager::PlaySoundEffect(int sound) {
#ifdef YGOPRO_USE_IRRKLANG #ifdef YGOPRO_USE_IRRKLANG
if(!mainGame->chkEnableSound->isChecked()) if(!mainGame->chkEnableSound->isChecked())
return; return;
engineSound->setSoundVolume(mainGame->gameConf.sound_volume);
switch(sound) { switch(sound) {
case SOUND_SUMMON: { case SOUND_SUMMON: {
engineSound->play2D("./sound/summon.wav"); engineSound->play2D("./sound/summon.wav");
...@@ -173,7 +174,6 @@ void SoundManager::PlaySoundEffect(int sound) { ...@@ -173,7 +174,6 @@ void SoundManager::PlaySoundEffect(int sound) {
default: default:
break; break;
} }
engineSound->setSoundVolume(mainGame->gameConf.sound_volume);
#endif #endif
} }
void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) { void SoundManager::PlayDialogSound(irr::gui::IGUIElement * element) {
...@@ -205,8 +205,8 @@ void SoundManager::PlayMusic(char* song, bool loop) { ...@@ -205,8 +205,8 @@ void SoundManager::PlayMusic(char* song, bool loop) {
return; return;
if(!engineMusic->isCurrentlyPlaying(song)) { if(!engineMusic->isCurrentlyPlaying(song)) {
engineMusic->stopAllSounds(); engineMusic->stopAllSounds();
soundBGM = engineMusic->play2D(song, loop, false, true);
engineMusic->setSoundVolume(mainGame->gameConf.music_volume); engineMusic->setSoundVolume(mainGame->gameConf.music_volume);
soundBGM = engineMusic->play2D(song, loop, false, true);
} }
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment