diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index d32ef1c4ca..2c7eecab1c 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -94,13 +94,19 @@ ScreenDebugOverlay::~ScreenDebugOverlay() { this->RemoveAllChildren(); - FOREACH( BitmapText*, m_vptextPages, p ) - SAFE_DELETE( *p ); - FOREACH( BitmapText*, m_vptextButton, p ) - SAFE_DELETE( *p ); + for (BitmapText *p : m_vptextPages) + { + SAFE_DELETE(p); + } + for (BitmapText *p : m_vptextButton) + { + SAFE_DELETE(p); + } m_vptextButton.clear(); - FOREACH( BitmapText*, m_vptextFunction, p ) - SAFE_DELETE( *p ); + for (BitmapText *p : m_vptextFunction) + { + SAFE_DELETE(p); + } m_vptextFunction.clear(); } @@ -215,12 +221,12 @@ void ScreenDebugOverlay::Init() map iNextDebugButton; int iNextGameplayButton = 0; - FOREACH( IDebugLine*, *g_pvpSubscribers, p ) + for (IDebugLine *p : *g_pvpSubscribers) { - RString sPageName = (*p)->GetPageName(); + RString sPageName = p->GetPageName(); DeviceInput di; - switch( (*p)->GetType() ) + switch( p->GetType() ) { case IDebugLine::all_screens: di = g_Mappings.debugButton[iNextDebugButton[sPageName]++]; @@ -229,7 +235,7 @@ void ScreenDebugOverlay::Init() di = g_Mappings.gameplayButton[iNextGameplayButton++]; break; } - (*p)->m_Button = di; + p->m_Button = di; if( find(m_asPages.begin(), m_asPages.end(), sPageName) == m_asPages.end() ) m_asPages.push_back( sPageName ); @@ -883,35 +889,35 @@ static void FillProfileStats( Profile *pProfile ) PREFSMAN->m_iMaxHighScoresPerListForPlayer.Get(); vector vpAllSongs = SONGMAN->GetAllSongs(); - FOREACH( Song*, vpAllSongs, pSong ) + for (Song const *pSong : vpAllSongs) { - vector vpAllSteps = (*pSong)->GetAllSteps(); - FOREACH( Steps*, vpAllSteps, pSteps ) + vector vpAllSteps = pSong->GetAllSteps(); + for (Steps const *pSteps : vpAllSteps) { if( rand() % 5 ) - pProfile->IncrementStepsPlayCount( *pSong, *pSteps ); + pProfile->IncrementStepsPlayCount( pSong, pSteps ); for( int i=0; iAddStepsHighScore( *pSong, *pSteps, MakeRandomHighScore(fPercentDP), iIndex ); + pProfile->AddStepsHighScore( pSong, pSteps, MakeRandomHighScore(fPercentDP), iIndex ); } } } vector vpAllCourses; SONGMAN->GetAllCourses( vpAllCourses, true ); - FOREACH( Course*, vpAllCourses, pCourse ) + for (Course const *pCourse : vpAllCourses) { vector vpAllTrails; - (*pCourse)->GetAllTrails( vpAllTrails ); - FOREACH( Trail*, vpAllTrails, pTrail ) + pCourse->GetAllTrails( vpAllTrails ); + for (Trail const *pTrail : vpAllTrails) { if( rand() % 5 ) - pProfile->IncrementCoursePlayCount( *pCourse, *pTrail ); + pProfile->IncrementCoursePlayCount( pCourse, pTrail ); for( int i=0; iAddCourseHighScore( *pCourse, *pTrail, MakeRandomHighScore(fPercentDP), iIndex ); + pProfile->AddCourseHighScore( pCourse, pTrail, MakeRandomHighScore(fPercentDP), iIndex ); } } }