don't allow multiple changes on the same beat

This commit is contained in:
Chris Danford
2005-06-05 03:16:57 +00:00
parent d6753dd5f7
commit ab794ffb2d
+10
View File
@@ -106,6 +106,16 @@ void Song::Reset()
void Song::AddBackgroundChange( BackgroundLayer iLayer, BackgroundChange seg )
{
// Delete old background change at this start beat, if any.
FOREACH( BackgroundChange, GetBackgroundChanges(iLayer), bgc )
{
if( bgc->m_fStartBeat == seg.m_fStartBeat )
{
GetBackgroundChanges(iLayer).erase( bgc );
break;
}
}
ASSERT( iLayer >= 0 && iLayer < NUM_BackgroundLayer );
GetBackgroundChanges(iLayer).push_back( seg );
BackgroundUtil::SortBackgroundChangesArray( GetBackgroundChanges(iLayer) );