diff --git a/data/CREDITS b/data/CREDITS index f052b445e..7ffce8089 100644 Binary files a/data/CREDITS and b/data/CREDITS differ diff --git a/src/audio/music_information.cpp b/src/audio/music_information.cpp index 287cc1a10..ecbd2f81b 100644 --- a/src/audio/music_information.cpp +++ b/src/audio/music_information.cpp @@ -51,7 +51,7 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt { // Create information just from ogg file // ------------------------------------- - m_title = StringUtils::removeExtension(StringUtils::getBasename(filename)); + m_title = core::stringw(StringUtils::removeExtension(StringUtils::getBasename(filename)).c_str()); m_normal_filename = filename; return; } @@ -73,7 +73,8 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt filename.c_str()); throw std::runtime_error("No music node found"); } - if(!root->get("title", &m_title)) + std::string title; + if(!root->get("title", &title)) { fprintf(stderr, "The 'title' attribute is missing in the music XML file '%s'!\n", @@ -81,7 +82,10 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt throw std::runtime_error("Incomplete or corrupt music XML file"); return; } - if(!root->get("composer", &m_composer)) + m_title = StringUtils::decodeFromHtmlEntities(title); + + std::string composer; + if(!root->get("composer", &composer)) { fprintf(stderr, "The 'composer' attribute is missing in the music XML file '%s'!\n", @@ -89,6 +93,8 @@ MusicInformation::MusicInformation(const std::string& filename) throw (std::runt throw std::runtime_error("Incomplete or corrupt music XML file"); return; } + m_composer = StringUtils::decodeFromHtmlEntities(composer); + if(!root->get("file", &m_normal_filename)) { fprintf(stderr, diff --git a/src/audio/music_information.hpp b/src/audio/music_information.hpp index bb220ccda..7a30a110b 100644 --- a/src/audio/music_information.hpp +++ b/src/audio/music_information.hpp @@ -26,6 +26,9 @@ #include "utils/no_copy.hpp" +#include +using irr::core::stringw; + class Music; /** @@ -37,8 +40,8 @@ class Music; class MusicInformation : public NoCopy { private: - std::string m_composer; - std::string m_title; + stringw m_composer; + stringw m_title; std::string m_normal_filename; std::string m_fast_filename; std::vector m_all_tracks; @@ -70,11 +73,11 @@ public: #endif MusicInformation (const std::string& filename) throw (std::runtime_error); ~MusicInformation (); - const std::string& getComposer () const {return m_composer; } - const std::string& getTitle () const {return m_title; } + const stringw& getComposer () const {return m_composer; } + const stringw& getTitle () const {return m_title; } const std::string& getNormalFilename() const {return m_normal_filename; } const std::string& getFastFilename () const {return m_fast_filename; } - //int getNumLoops () const {return m_numLoops; } + //int getNumLoops () const {return m_numLoops; } float getFasterTime () const {return m_faster_time; } float getMaxPitch () const {return m_max_pitch; } void addMusicToTracks (); diff --git a/src/states_screens/race_gui_base.cpp b/src/states_screens/race_gui_base.cpp index e7b1b850e..84cb1392f 100644 --- a/src/states_screens/race_gui_base.cpp +++ b/src/states_screens/race_gui_base.cpp @@ -575,8 +575,7 @@ void RaceGUIBase::drawGlobalMusicDescription() const MusicInformation* mi = music_manager->getCurrentMusic(); if (!mi) return; - std::string s="\""+mi->getTitle()+"\""; - core::stringw thetext(s.c_str()); + core::stringw thetext = core::stringw(L"\"") + mi->getTitle() + L"\""; core::dimension2d< u32 > textSize = font->getDimension(thetext.c_str()); int textWidth = textSize.Width; @@ -616,8 +615,7 @@ void RaceGUIBase::drawGlobalMusicDescription() { core::rect pos_by(textXFrom, text_y+40, textXTo, text_y+40); - std::string s="by "+mi->getComposer(); - font->draw(core::stringw(s.c_str()).c_str(), pos_by, white, + font->draw(thetext_composer, pos_by, white, true, true); }