Delay start for 3s when intro sound is off
To bridge the silence before ready-set-go, the engines are started earlier than normal if intro sound is off.
This commit is contained in:
parent
d4f1f28070
commit
342b4f299e
@ -30,6 +30,21 @@
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Starts the kart engines.
|
||||
*/
|
||||
void WorldStatus::startEngines()
|
||||
{
|
||||
if (m_engines_started)
|
||||
return;
|
||||
|
||||
m_engines_started = true;
|
||||
for (unsigned int i = 0; i < World::getWorld()->getNumKarts(); i++)
|
||||
{
|
||||
World::getWorld()->getKart(i)->startEngineSFX();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
WorldStatus::WorldStatus()
|
||||
{
|
||||
@ -55,6 +70,9 @@ void WorldStatus::reset()
|
||||
{
|
||||
m_time = 0.0f;
|
||||
m_auxiliary_timer = 0.0f;
|
||||
|
||||
m_engines_started = false;
|
||||
|
||||
// Using SETUP_PHASE will play the track into sfx first, and has no
|
||||
// other side effects.
|
||||
m_phase = UserConfigParams::m_race_now ? MUSIC_PHASE : SETUP_PHASE;
|
||||
@ -185,6 +203,13 @@ void WorldStatus::update(const float dt)
|
||||
if (!UserConfigParams::m_sfx && m_auxiliary_timer < 3.0f)
|
||||
return;
|
||||
|
||||
if (!m_play_track_intro_sound)
|
||||
{
|
||||
startEngines();
|
||||
if (m_auxiliary_timer < 3.0f)
|
||||
return;
|
||||
}
|
||||
|
||||
m_auxiliary_timer = 0.0f;
|
||||
|
||||
if (m_play_ready_set_go_sounds)
|
||||
@ -192,10 +217,7 @@ void WorldStatus::update(const float dt)
|
||||
|
||||
m_phase = READY_PHASE;
|
||||
|
||||
for (unsigned int i = 0; i < World::getWorld()->getNumKarts(); i++)
|
||||
{
|
||||
World::getWorld()->getKart(i)->startEngineSFX();
|
||||
}
|
||||
startEngines();
|
||||
|
||||
break;
|
||||
case READY_PHASE:
|
||||
|
@ -114,6 +114,8 @@ private:
|
||||
*/
|
||||
float m_auxiliary_timer;
|
||||
|
||||
bool m_engines_started;
|
||||
void startEngines();
|
||||
public:
|
||||
WorldStatus();
|
||||
virtual ~WorldStatus();
|
||||
|
Loading…
x
Reference in New Issue
Block a user