SFX bugfixes: Fixed sound burst when returning from in-race menu. Fixed skiding sound to match new physics.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2505 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
eba95cb6d0
commit
b54d6a7ef2
@ -245,7 +245,6 @@ void SFXManager::deleteSFX(SFXBase *sfx)
|
|||||||
*/
|
*/
|
||||||
void SFXManager::pauseAll()
|
void SFXManager::pauseAll()
|
||||||
{
|
{
|
||||||
|
|
||||||
for(std::vector<SFXBase*>::iterator i=m_all_sfx.begin();
|
for(std::vector<SFXBase*>::iterator i=m_all_sfx.begin();
|
||||||
i!=m_all_sfx.end(); i++)
|
i!=m_all_sfx.end(); i++)
|
||||||
{
|
{
|
||||||
@ -262,7 +261,7 @@ void SFXManager::resumeAll()
|
|||||||
{
|
{
|
||||||
SFXStatus status = (*i)->getStatus();
|
SFXStatus status = (*i)->getStatus();
|
||||||
// Initial happens when
|
// Initial happens when
|
||||||
if(status==SFX_PAUSED || status==SFX_INITIAL)
|
if(status==SFX_PAUSED)
|
||||||
(*i)->resume();
|
(*i)->resume();
|
||||||
} // for i in m_all_sfx
|
} // for i in m_all_sfx
|
||||||
} // resumeAll
|
} // resumeAll
|
||||||
|
@ -725,20 +725,12 @@ void Kart::updatePhysics (float dt)
|
|||||||
|
|
||||||
//apply the brakes
|
//apply the brakes
|
||||||
for(int i=0; i<4; i++) m_vehicle->setBrake(getBrakeFactor() * 4.0f, i);
|
for(int i=0; i<4; i++) m_vehicle->setBrake(getBrakeFactor() * 4.0f, i);
|
||||||
|
m_skidding*= 1.08f;//skid a little when the brakes are hit (just enough to make the skiding sound)
|
||||||
m_skid_sound->position( getXYZ() );
|
if(m_skidding>2.0f) m_skidding=2.0f;
|
||||||
if(m_skid_sound->getStatus() != SFXManager::SFX_PLAYING)
|
|
||||||
{
|
|
||||||
m_skid_sound->loop();
|
|
||||||
m_skid_sound->play();
|
|
||||||
}
|
|
||||||
m_reverse_allowed = false;
|
m_reverse_allowed = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no braking sound
|
|
||||||
if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING) m_skid_sound->stop();
|
|
||||||
|
|
||||||
if(m_reverse_allowed)
|
if(m_reverse_allowed)
|
||||||
{
|
{
|
||||||
// going backward, apply reverse gear ratio
|
// going backward, apply reverse gear ratio
|
||||||
@ -763,9 +755,6 @@ void Kart::updatePhysics (float dt)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// not braking, stop sound
|
|
||||||
if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING) m_skid_sound->stop();
|
|
||||||
|
|
||||||
// lift the foot from throttle, brakes with 10% engine_power
|
// lift the foot from throttle, brakes with 10% engine_power
|
||||||
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 2);
|
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 2);
|
||||||
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 3);
|
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 3);
|
||||||
@ -807,7 +796,8 @@ void Kart::updatePhysics (float dt)
|
|||||||
}
|
}
|
||||||
if(m_skidding>1.0f)
|
if(m_skidding>1.0f)
|
||||||
{
|
{
|
||||||
m_skid_sound->play();
|
if(m_skid_sound->getStatus() != SFXManager::SFX_PLAYING)
|
||||||
|
m_skid_sound->play();
|
||||||
}
|
}
|
||||||
else if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING)
|
else if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user