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:
stevo14 2008-11-25 21:05:35 +00:00
parent eba95cb6d0
commit b54d6a7ef2
2 changed files with 5 additions and 16 deletions

View File

@ -245,7 +245,6 @@ void SFXManager::deleteSFX(SFXBase *sfx)
*/
void SFXManager::pauseAll()
{
for(std::vector<SFXBase*>::iterator i=m_all_sfx.begin();
i!=m_all_sfx.end(); i++)
{
@ -262,7 +261,7 @@ void SFXManager::resumeAll()
{
SFXStatus status = (*i)->getStatus();
// Initial happens when
if(status==SFX_PAUSED || status==SFX_INITIAL)
if(status==SFX_PAUSED)
(*i)->resume();
} // for i in m_all_sfx
} // resumeAll

View File

@ -725,20 +725,12 @@ void Kart::updatePhysics (float dt)
//apply the brakes
for(int i=0; i<4; i++) m_vehicle->setBrake(getBrakeFactor() * 4.0f, i);
m_skid_sound->position( getXYZ() );
if(m_skid_sound->getStatus() != SFXManager::SFX_PLAYING)
{
m_skid_sound->loop();
m_skid_sound->play();
}
m_skidding*= 1.08f;//skid a little when the brakes are hit (just enough to make the skiding sound)
if(m_skidding>2.0f) m_skidding=2.0f;
m_reverse_allowed = false;
}
else
{
// no braking sound
if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING) m_skid_sound->stop();
if(m_reverse_allowed)
{
// going backward, apply reverse gear ratio
@ -763,9 +755,6 @@ void Kart::updatePhysics (float dt)
}
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
m_vehicle->applyEngineForce(-m_controls.accel*engine_power*0.1f, 2);
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)
{
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)
{