optimize adding background changes

I have a song with 5841 background changes and it took 3 seconds to load that song.
This commit is contained in:
Thai Pangsakulyanont
2012-05-21 14:27:17 +07:00
parent 1c85c74785
commit 2b6670c2df
3 changed files with 10 additions and 4 deletions
+7
View File
@@ -129,6 +129,13 @@ void BackgroundUtil::SortBackgroundChangesArray( vector<BackgroundChange> &vBack
sort( vBackgroundChanges.begin(), vBackgroundChanges.end(), CompareBackgroundChanges );
}
void BackgroundUtil::AddBackgroundChange( vector<BackgroundChange> &vBackgroundChanges, BackgroundChange seg )
{
vector<BackgroundChange>::iterator it;
it = upper_bound( vBackgroundChanges.begin(), vBackgroundChanges.end(), seg, CompareBackgroundChanges );
vBackgroundChanges.insert( it, seg );
}
void BackgroundUtil::GetBackgroundEffects( const RString &_sName, vector<RString> &vsPathsOut, vector<RString> &vsNamesOut )
{
RString sName = _sName;