Fixed title music

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5042 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-03-22 02:06:01 +00:00
parent 84f4d6d3f3
commit a73cf90dca
2 changed files with 8 additions and 3 deletions

View File

@ -99,6 +99,7 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt
throw std::runtime_error("Incomplete or corrupt music XML file");
return;
}
assert(m_normal_filename.size() > 0);
}
else if (node->getName() == "gain")
{
@ -153,6 +154,7 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt
// Get the path from the filename and add it to the ogg filename
std::string path = StringUtils::getPath(filename);
m_normal_filename = path + "/" + m_normal_filename;
std::cout << "m_normal_filename=<" << m_normal_filename.c_str() << ">\n";
// Get the path from the filename and add it to the ogg filename
if (m_fast_filename != "")
@ -179,13 +181,16 @@ void MusicInformation::startMusic()
m_time_since_faster = 0.0f;
m_mode = SOUND_NORMAL;
std::cout << "startMusic : m_normal_filename=<" << m_normal_filename.c_str() << ">\n";
if (m_normal_filename== "") return;
// First load the 'normal' music
// -----------------------------
if(StringUtils::getExtension(m_normal_filename)!="ogg")
if (StringUtils::getExtension(m_normal_filename) != "ogg")
{
fprintf(stderr, "WARNING: music file %s format not recognized.\n",
fprintf(stderr, "WARNING: music file %s is not found or file format is not recognized.\n",
m_normal_filename.c_str());
return;
}

View File

@ -186,7 +186,7 @@ void STKConfig::getAllData(const XMLNode * root)
if(const XMLNode *leader_node= root->getNode("follow-the-leader"))
leader_node->get("intervals", &m_leader_intervals);
if(const XMLNode *music_node = root->getNode("grand-prix"))
if(const XMLNode *music_node = root->getNode("music"))
{
std::string title_music;
music_node->get("title", &title_music);