More audio improvements
- Fix a bug that made the last lap SFX played only if music was on. - Fix the behavior of the music volume adjustment when the last lap SFX is played. Previously, the music volume was only adjusted when the music volume was above a certain threshold, but when it was above that threshold, the adjustment was too strong.
This commit is contained in:
parent
40511b218c
commit
e744fd3033
@ -421,17 +421,20 @@ void LinearWorld::newLap(unsigned int kart_index)
|
|||||||
}
|
}
|
||||||
if(!m_last_lap_sfx_played && lap_count > 1)
|
if(!m_last_lap_sfx_played && lap_count > 1)
|
||||||
{
|
{
|
||||||
if (UserConfigParams::m_music)
|
if (UserConfigParams::m_sfx)
|
||||||
{
|
{
|
||||||
m_last_lap_sfx->play();
|
m_last_lap_sfx->play();
|
||||||
m_last_lap_sfx_played = true;
|
m_last_lap_sfx_played = true;
|
||||||
m_last_lap_sfx_playing = true;
|
m_last_lap_sfx_playing = true;
|
||||||
|
|
||||||
// In case that no music is defined
|
// Temporarily reduce the volume of the main music
|
||||||
if(music_manager->getCurrentMusic() &&
|
// So that the last lap SFX can be heard
|
||||||
music_manager->getMasterMusicVolume() > 0.2f)
|
if(UserConfigParams::m_music &&
|
||||||
|
music_manager->getCurrentMusic())
|
||||||
{
|
{
|
||||||
music_manager->setTemporaryVolume(0.2f);
|
// The parameter taken by SetTemporaryVolume is a factor
|
||||||
|
// that gets multiplied with the master volume
|
||||||
|
music_manager->setTemporaryVolume(0.5f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1686,6 +1686,7 @@ void ClientLobby::handleClientCommand(const std::string& cmd)
|
|||||||
AddonsPack::install(argv[1]);
|
AddonsPack::install(argv[1]);
|
||||||
else if (argv[0] == "uninstalladdon" && argv.size() == 2)
|
else if (argv[0] == "uninstalladdon" && argv.size() == 2)
|
||||||
AddonsPack::uninstall(argv[1]);
|
AddonsPack::uninstall(argv[1]);
|
||||||
|
// FIXME - this code duplicates functions that should be handled elsewhere.
|
||||||
else if (argv[0] == "music" && argv.size() == 2)
|
else if (argv[0] == "music" && argv.size() == 2)
|
||||||
{
|
{
|
||||||
int vol = atoi(argv[1].c_str());
|
int vol = atoi(argv[1].c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user