mirror of
https://github.com/glest/glest-source.git
synced 2025-08-18 14:11:15 +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();
|
config.save();
|
||||||
Renderer::getInstance().loadConfig();
|
|
||||||
SoundRenderer::getInstance().loadConfig();
|
SoundRenderer::getInstance().loadConfig();
|
||||||
|
SoundRenderer::getInstance().setMusicVolume(CoreData::getInstance().getMenuMusic());
|
||||||
|
Renderer::getInstance().loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuStateOptions::setActiveInputLable(GraphicLabel *newLable)
|
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){
|
void SoundRenderer::stopMusic(StrSound *strSound){
|
||||||
if(soundPlayer != NULL) {
|
if(soundPlayer != NULL) {
|
||||||
if(runThreadSafe == true) mutex.p();
|
if(runThreadSafe == true) mutex.p();
|
||||||
|
@@ -62,6 +62,7 @@ public:
|
|||||||
|
|
||||||
//music
|
//music
|
||||||
void playMusic(StrSound *strSound);
|
void playMusic(StrSound *strSound);
|
||||||
|
void setMusicVolume(StrSound *strSound);
|
||||||
void stopMusic(StrSound *strSound);
|
void stopMusic(StrSound *strSound);
|
||||||
|
|
||||||
//fx
|
//fx
|
||||||
|
@@ -200,6 +200,9 @@ void StreamSoundSource::update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
if(fadeState == NoFading){
|
||||||
|
alSourcef(source, AL_GAIN, sound->getVolume());
|
||||||
|
}
|
||||||
|
|
||||||
ALint processed = 0;
|
ALint processed = 0;
|
||||||
alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
|
alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);
|
||||||
|
Reference in New Issue
Block a user