Integrate C++11 branch into 5_1-new
This commit is contained in:
@@ -40,14 +40,14 @@ public:
|
||||
if( pSong ) // playing a song
|
||||
{
|
||||
GetStepsForSong( pSong, m_vpSteps );
|
||||
FOREACH_CONST( Steps*, m_vpSteps, steps )
|
||||
for (Steps const *steps : m_vpSteps)
|
||||
{
|
||||
RString s;
|
||||
if( (*steps)->GetDifficulty() == Difficulty_Edit )
|
||||
s = (*steps)->GetDescription();
|
||||
if( steps->GetDifficulty() == Difficulty_Edit )
|
||||
s = steps->GetDescription();
|
||||
else
|
||||
s = CustomDifficultyToLocalizedString( StepsToCustomDifficulty(*steps) );
|
||||
s += ssprintf( " %d", (*steps)->GetMeter() );
|
||||
s = CustomDifficultyToLocalizedString( StepsToCustomDifficulty(steps) );
|
||||
s += ssprintf( " %d", steps->GetMeter() );
|
||||
m_Def.m_vsChoices.push_back( s );
|
||||
}
|
||||
m_Def.m_vEnabledForPlayers.clear();
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
else
|
||||
{
|
||||
m_Def.m_vsChoices.push_back( "n/a" );
|
||||
m_vpSteps.push_back( NULL );
|
||||
m_vpSteps.push_back(nullptr);
|
||||
m_Def.m_vEnabledForPlayers.clear();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ void ScreenOptionsEditCourse::Init()
|
||||
|
||||
const MenuRowDef g_MenuRows[] =
|
||||
{
|
||||
MenuRowDef( -1, "Max Minutes", true, EditMode_Practice, true, false, 0, NULL ),
|
||||
MenuRowDef( -1, "Max Minutes", true, EditMode_Practice, true, false, 0, nullptr ),
|
||||
};
|
||||
|
||||
static LocalizedString EMPTY ("ScreenOptionsEditCourse","-Empty-");
|
||||
@@ -201,8 +201,8 @@ void ScreenOptionsEditCourse::BeginScreen()
|
||||
{
|
||||
{
|
||||
MenuRowDef mrd = MenuRowDef( -1, "---", true, EditMode_Practice, true, false, 0, EMPTY.GetValue() );
|
||||
FOREACH_CONST( Song*, m_vpSongs, s )
|
||||
mrd.choices.push_back( (*s)->GetDisplayFullTitle() );
|
||||
for (Song const *s : m_vpSongs)
|
||||
mrd.choices.push_back( s->GetDisplayFullTitle() );
|
||||
mrd.sName = ssprintf(SONG.GetValue() + " %d",i+1);
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeSimple( mrd );
|
||||
pHand->m_Def.m_bAllowThemeTitle = false; // already themed
|
||||
@@ -274,7 +274,7 @@ void ScreenOptionsEditCourse::ImportOptions( int iRow, const vector<PlayerNumber
|
||||
DEFAULT_FAIL( rowType );
|
||||
case RowType_Song:
|
||||
{
|
||||
Song *pSong = NULL;
|
||||
Song *pSong = nullptr;
|
||||
if( iEntryIndex < (int)GAMESTATE->m_pCurCourse->m_vEntries.size() )
|
||||
pSong = GAMESTATE->m_pCurCourse->m_vEntries[iEntryIndex].songID.ToSong();
|
||||
|
||||
@@ -335,7 +335,7 @@ void ScreenOptionsEditCourse::ExportOptions( int iRow, const vector<PlayerNumber
|
||||
if( pSong )
|
||||
{
|
||||
Steps *pSteps = this->GetStepsForEntry( iEntryIndex );
|
||||
ASSERT_M( pSteps != NULL, "No Steps for this Song!" );
|
||||
ASSERT_M( pSteps != nullptr, "No Steps for this Song!" );
|
||||
CourseEntry ce;
|
||||
ce.songID.FromSong( pSong );
|
||||
ce.stepsCriteria.m_difficulty = pSteps->GetDifficulty();
|
||||
@@ -379,14 +379,14 @@ void ScreenOptionsEditCourse::SetCurrentSong()
|
||||
|
||||
if( row.GetRowType() == OptionRow::RowType_Exit )
|
||||
{
|
||||
GAMESTATE->m_pCurSong.Set( NULL );
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
||||
GAMESTATE->m_pCurSong.Set(nullptr);
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
iRow = m_iCurrentRow[PLAYER_1];
|
||||
int iEntryIndex = RowToEntryIndex( iRow );
|
||||
Song *pSong = NULL;
|
||||
Song *pSong = nullptr;
|
||||
if( iEntryIndex != -1 )
|
||||
{
|
||||
int iCurrentSongRow = EntryIndexAndRowTypeToRow(iEntryIndex,RowType_Song);
|
||||
@@ -395,7 +395,7 @@ void ScreenOptionsEditCourse::SetCurrentSong()
|
||||
if( index != 0 )
|
||||
pSong = m_vpSongs[ index - 1 ];
|
||||
}
|
||||
if ( pSong != NULL )
|
||||
if ( pSong != nullptr )
|
||||
{
|
||||
GAMESTATE->m_pCurSong.Set( pSong );
|
||||
}
|
||||
@@ -412,13 +412,13 @@ void ScreenOptionsEditCourse::SetCurrentSteps()
|
||||
OptionRow &row = *m_pRows[ EntryIndexAndRowTypeToRow(iEntryIndex, RowType_Steps) ];
|
||||
int iStepsIndex = row.GetOneSharedSelection();
|
||||
const EditCourseOptionRowHandlerSteps *pHand = dynamic_cast<const EditCourseOptionRowHandlerSteps *>( row.GetHandler() );
|
||||
ASSERT( pHand != NULL );
|
||||
ASSERT( pHand != nullptr );
|
||||
Steps *pSteps = pHand->GetSteps( iStepsIndex );
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( pSteps );
|
||||
}
|
||||
else
|
||||
{
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ Song *ScreenOptionsEditCourse::GetSongForEntry( int iEntryIndex )
|
||||
|
||||
int index = row.GetOneSharedSelection();
|
||||
if( index == 0 )
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return m_vpSongs[ index - 1 ];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user