Make some flyable sfx lower volume in splitscreen multiplayer
This commit is contained in:
parent
ad531ba556
commit
5ec99947e9
@ -38,6 +38,7 @@ Bowling::Bowling(AbstractKart *kart)
|
||||
{
|
||||
m_has_hit_kart = false;
|
||||
m_roll_sfx = SFXManager::get()->createSoundSource("bowling_roll");
|
||||
fixSFXSplitscreen(m_roll_sfx);
|
||||
m_roll_sfx->play();
|
||||
m_roll_sfx->setLoop(true);
|
||||
} // Bowling
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <IMeshManipulator.h>
|
||||
#include <IMeshSceneNode.h>
|
||||
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "achievements/achievements_status.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "graphics/explosion.hpp"
|
||||
@ -809,4 +810,12 @@ void Flyable::onDeleteFlyable()
|
||||
moveToInfinity();
|
||||
} // onDeleteFlyable
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/* Make specifc sfx lower volume if needed in splitscreen multiplayer. */
|
||||
void Flyable::fixSFXSplitscreen(SFXBase* sfx)
|
||||
{
|
||||
if (sfx && RaceManager::get()->getNumLocalPlayers() > 1)
|
||||
sfx->setVolume(1.0f / (float)RaceManager::get()->getNumLocalPlayers());
|
||||
} // fixSFXSplitscreen
|
||||
|
||||
/* EOF */
|
||||
|
@ -39,6 +39,7 @@ class AbstractKart;
|
||||
class AbstractKartAnimation;
|
||||
class HitEffect;
|
||||
class PhysicalObject;
|
||||
class SFXBase;
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
@ -184,6 +185,7 @@ protected:
|
||||
|
||||
void moveToInfinity(bool set_moveable_trans = true);
|
||||
void removePhysics();
|
||||
void fixSFXSplitscreen(SFXBase* sfx);
|
||||
public:
|
||||
|
||||
Flyable (AbstractKart* kart,
|
||||
|
@ -71,6 +71,7 @@ RubberBall::RubberBall(AbstractKart *kart)
|
||||
|
||||
m_target = NULL;
|
||||
m_ping_sfx = SFXManager::get()->createSoundSource("ball_bounce");
|
||||
fixSFXSplitscreen(m_ping_sfx);
|
||||
} // RubberBall
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user