Fixed music crash bug

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1849 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
cosmosninja 2008-05-10 23:29:04 +00:00
parent 228c5fb117
commit 89617347fe
2 changed files with 9 additions and 2 deletions

View File

@ -170,6 +170,8 @@ void MusicInformation::update(float dt)
switch(m_mode)
{
case SOUND_FADING: {
if ( m_normal_music == NULL || m_fast_music == NULL ) break;
m_time_since_faster +=dt;
if(m_time_since_faster>=m_faster_time)
{
@ -184,10 +186,12 @@ void MusicInformation::update(float dt)
break;
}
case SOUND_FASTER: {
if ( m_normal_music == NULL ) break;
m_time_since_faster +=dt;
if(m_time_since_faster>=m_faster_time)
{
// Once the pitch is adjusted, just switch back to normal
// Once the pitch is adjusted, just switch back to normal
// mode. We can't switch to fast music mode, since this would
// play m_fast_music, which isn't available.
m_mode=SOUND_NORMAL;
@ -199,9 +203,13 @@ void MusicInformation::update(float dt)
break;
}
case SOUND_NORMAL:
if ( m_normal_music == NULL ) break;
m_normal_music->update();
break;
case SOUND_FAST:
if ( m_fast_music == NULL ) break;
m_fast_music->update();
break;
} // switch

View File

@ -60,7 +60,6 @@ bool MusicOggStream::load(const std::string& filename)
return false;
}
//m_fileName = file_manager->getMusicFile(filename);
m_fileName = filename;
if(m_fileName=="") return false;