Only play start and lap fanfares if music is enabled

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7771 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-02-28 16:19:43 +00:00
parent 04adf0bf63
commit 589abb4333
2 changed files with 17 additions and 8 deletions

View File

@ -293,14 +293,22 @@ void LinearWorld::newLap(unsigned int kart_index)
3.0f, 40, video::SColor(255, 210, 100, 50), true);
if(!m_last_lap_sfx_played && lap_count > 1)
{
m_last_lap_sfx->play();
m_last_lap_sfx_played = true;
m_last_lap_sfx_playing = true;
// In case that no music is defined
if(music_manager->getCurrentMusic() && music_manager->getMasterMusicVolume() > 0.2f)
if (UserConfigParams::m_music)
{
music_manager->getCurrentMusic()->setTemporaryVolume(0.2f);
m_last_lap_sfx->play();
m_last_lap_sfx_played = true;
m_last_lap_sfx_playing = true;
// In case that no music is defined
if(music_manager->getCurrentMusic() && music_manager->getMasterMusicVolume() > 0.2f)
{
music_manager->getCurrentMusic()->setTemporaryVolume(0.2f);
}
}
else
{
m_last_lap_sfx_played = true;
m_last_lap_sfx_playing = false;
}
}
}

View File

@ -126,7 +126,8 @@ void WorldStatus::update(const float dt)
case SETUP_PHASE:
m_auxiliary_timer = 0.0f;
m_phase = TRACK_INTRO_PHASE;
m_track_intro_sound->play();
if (UserConfigParams::m_music)
m_track_intro_sound->play();
return;
case TRACK_INTRO_PHASE:
if(m_track_intro_sound->getStatus()==SFXManager::SFX_PLAYING)