More sound tweaks in multiplayer
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8592 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
32a534b80f
commit
a3b3fafe27
@ -232,9 +232,6 @@ void Powerup::use()
|
||||
// so the sounds of all AIs are constantly heard. So reduce volume of sounds.
|
||||
if (race_manager->getNumLocalPlayers() > 1)
|
||||
{
|
||||
const int np = race_manager->getNumLocalPlayers();
|
||||
const int nai = race_manager->getNumberOfKarts() - np;
|
||||
|
||||
// player karts played at full volume; AI karts much dimmer
|
||||
|
||||
if (m_owner->getController()->isPlayerController())
|
||||
@ -243,7 +240,7 @@ void Powerup::use()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sound_use->volume( 1.0f / nai );
|
||||
m_sound_use->volume( std::min(0.5f, 1.0f / race_manager->getNumberOfKarts()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,10 +144,12 @@ Kart::Kart (const std::string& ident, Track* track, int position, bool is_first_
|
||||
{
|
||||
if (type == RaceManager::KT_PLAYER)
|
||||
{
|
||||
m_goo_sound->volume( 1.0f / race_manager->getNumLocalPlayers() );
|
||||
m_skid_sound->volume( 1.0f / race_manager->getNumLocalPlayers() );
|
||||
m_crash_sound->volume( 1.0f / race_manager->getNumLocalPlayers() );
|
||||
m_beep_sound->volume( 1.0f / race_manager->getNumLocalPlayers() );
|
||||
// players have louder sounds than AIs
|
||||
const float factor = std::min(1.0f, race_manager->getNumLocalPlayers()/2.0f);
|
||||
m_goo_sound->volume( 1.0f / factor );
|
||||
m_skid_sound->volume( 1.0f / factor );
|
||||
m_crash_sound->volume( 1.0f / factor );
|
||||
m_beep_sound->volume( 1.0f / factor );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user