diff --git a/stepmania/src/LyricsLoader.cpp b/stepmania/src/LyricsLoader.cpp index c1e71b2a35..684a51ecfb 100644 --- a/stepmania/src/LyricsLoader.cpp +++ b/stepmania/src/LyricsLoader.cpp @@ -13,6 +13,10 @@ #include using namespace std; +static int CompareLyricSegments(const LyricSegment &seg1, const LyricSegment &seg2) +{ + return seg1.m_fStartTime < seg2.m_fStartTime; +} bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out ) { @@ -29,6 +33,8 @@ bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out ) RageColor CurrentColor(0,1,0,1); + out.m_LyricSegments.clear(); + while(input.good() && getline(input, line)) { if(!line.compare(0, 2, "//")) @@ -83,6 +89,8 @@ bool LyricsLoader::LoadFromLRCFile( CString sPath, Song &out ) } + sort( out.m_LyricSegments.begin(), out.m_LyricSegments.end(), CompareLyricSegments ); + return true; }