Use the standard for each instead.

It includes a way to deal with the "last song" case.
This commit is contained in:
Jason Felds
2013-04-28 18:01:47 -04:00
parent e4544bd3c1
commit 132a301712
+4 -6
View File
@@ -177,18 +177,16 @@ void GraphDisplay::Set( const StageStats &ss, const PlayerStageStats &pss )
// Show song boundaries
float fSec = 0;
vector<Song *> const &possibleSongs = ss.m_vpPossibleSongs;
for (vector<Song *>::const_iterator song = possibleSongs.begin(); song != possibleSongs.end(); ++song)
{
if( song == ss.m_vpPossibleSongs.end()-1 )
continue;
fSec += (*song)->GetStepsSeconds();
std::for_each(possibleSongs.begin(), possibleSongs.end() - 1, [&](Song *song) {
fSec += song->GetStepsSeconds();
Actor *p = m_sprSongBoundary->Copy();
m_vpSongBoundaries.push_back( p );
float fX = SCALE( fSec, 0, fTotalStepSeconds, m_quadVertices.left, m_quadVertices.right );
p->SetX( fX );
this->AddChild( p );
}
});
if( !pss.m_bFailed )
{