From a73cf90dca9d6e0f2e975277ba4170af0ff73d8b Mon Sep 17 00:00:00 2001 From: auria Date: Mon, 22 Mar 2010 02:06:01 +0000 Subject: [PATCH] Fixed title music git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5042 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/audio/music_information.cpp | 9 +++++++-- src/config/stk_config.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/audio/music_information.cpp b/src/audio/music_information.cpp index ca4c8d763..05cb11cb8 100644 --- a/src/audio/music_information.cpp +++ b/src/audio/music_information.cpp @@ -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; } diff --git a/src/config/stk_config.cpp b/src/config/stk_config.cpp index 7e7a20efc..d3d41ac80 100644 --- a/src/config/stk_config.cpp +++ b/src/config/stk_config.cpp @@ -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);