mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
volume changes in the options menu have instant effect when pressing OK
This commit is contained in:
@@ -468,8 +468,9 @@ void MenuStateOptions::saveConfig(){
|
||||
}
|
||||
|
||||
config.save();
|
||||
Renderer::getInstance().loadConfig();
|
||||
SoundRenderer::getInstance().loadConfig();
|
||||
SoundRenderer::getInstance().setMusicVolume(CoreData::getInstance().getMenuMusic());
|
||||
Renderer::getInstance().loadConfig();
|
||||
}
|
||||
|
||||
void MenuStateOptions::setActiveInputLable(GraphicLabel *newLable)
|
||||
|
@@ -105,6 +105,10 @@ void SoundRenderer::playMusic(StrSound *strSound){
|
||||
}
|
||||
}
|
||||
|
||||
void SoundRenderer::setMusicVolume(StrSound *strSound){
|
||||
strSound->setVolume(musicVolume);
|
||||
}
|
||||
|
||||
void SoundRenderer::stopMusic(StrSound *strSound){
|
||||
if(soundPlayer != NULL) {
|
||||
if(runThreadSafe == true) mutex.p();
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
|
||||
//music
|
||||
void playMusic(StrSound *strSound);
|
||||
void setMusicVolume(StrSound *strSound);
|
||||
void stopMusic(StrSound *strSound);
|
||||
|
||||
//fx
|
||||
|
@@ -200,7 +200,10 @@ void StreamSoundSource::update()
|
||||
}
|
||||
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(fadeState == NoFading){
|
||||
alSourcef(source, AL_GAIN, sound->getVolume());
|
||||
}
|
||||
|
||||
ALint processed = 0;
|
||||
alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
|
||||
while(processed > 0) {
|
||||
|
Reference in New Issue
Block a user