}
void
-SoundManager::stop_music(bool fade)
+SoundManager::stop_music(float fadetime)
{
- if(fade) {
+ if(fadetime > 0) {
if(music_source
&& music_source->get_fade_state() != StreamSoundSource::FadingOff)
- music_source->set_fading(StreamSoundSource::FadingOff, .5f);
+ music_source->set_fading(StreamSoundSource::FadingOff, fadetime);
} else {
delete music_source;
music_source = 0;
void enable_music(bool music_enabled);
void play_music(const std::string& filename, bool fade = false);
- void stop_music(bool fade = true);
+ void stop_music(float fadetime = 0);
bool is_sound_enabled() { return sound_enabled; }
currentsector = 0;
game_pause = false;
- music_playing = false;
fps_fps = 0;
context = new DrawingContext();
if(mode == ST_GL_PLAY || mode == ST_GL_LOAD_LEVEL_FILE)
levelintro();
- if (!music_playing)
- {
- currentsector->play_music(LEVEL_MUSIC);
- music_playing = true;
- }
+ currentsector->play_music(LEVEL_MUSIC);
if(capture_file != "")
record_demo(capture_file);
{
char str[60];
+ sound_manager->stop_music();
+
DrawingContext context;
for(Sector::GameObjects::iterator i = currentsector->gameobjects.begin();
i != currentsector->gameobjects.end(); ++i) {
CodeController* end_sequence_controller;
bool game_pause;
- bool music_playing;
std::string levelfile;
if(config->use_fullscreen != options_menu->is_toggled(MNID_FULLSCREEN)) {
config->use_fullscreen = !config->use_fullscreen;
init_video();
+ config->save();
}
break;
case MNID_SOUND:
if(config->sound_enabled != options_menu->is_toggled(MNID_SOUND)) {
config->sound_enabled = !config->sound_enabled;
sound_manager->enable_sound(config->sound_enabled);
+ config->save();
}
break;
case MNID_MUSIC:
if(config->music_enabled != options_menu->is_toggled(MNID_MUSIC)) {
config->music_enabled = !config->music_enabled;
sound_manager->enable_music(config->music_enabled);
+ config->save();
}
break;
default: