Integrate C++11 branch into 5_1-new
This commit is contained in:
+16
-17
@@ -47,7 +47,7 @@ void OptionListRow::SetFromHandler( const OptionRowHandler *pHandler )
|
||||
this->FinishTweening();
|
||||
this->RemoveAllChildren();
|
||||
|
||||
if( pHandler == NULL )
|
||||
if( pHandler == nullptr )
|
||||
return;
|
||||
|
||||
int iNum = max( pHandler->m_Def.m_vsChoices.size(), m_Text.size() )+1;
|
||||
@@ -101,7 +101,7 @@ void OptionListRow::SetFromHandler( const OptionRowHandler *pHandler )
|
||||
|
||||
void OptionListRow::SetTextFromHandler( const OptionRowHandler *pHandler )
|
||||
{
|
||||
ASSERT( pHandler != NULL );
|
||||
ASSERT( pHandler != nullptr );
|
||||
for( unsigned i = 0; i < pHandler->m_Def.m_vsChoices.size(); ++i )
|
||||
{
|
||||
// init text
|
||||
@@ -172,13 +172,13 @@ void OptionListRow::PositionCursor( Actor *pCursor, int iSelection )
|
||||
OptionsList::OptionsList()
|
||||
{
|
||||
m_iCurrentRow = 0;
|
||||
m_pLinked = NULL;
|
||||
m_pLinked = nullptr;
|
||||
}
|
||||
|
||||
OptionsList::~OptionsList()
|
||||
{
|
||||
FOREACHM( RString, OptionRowHandler *, m_Rows, hand )
|
||||
delete hand->second;
|
||||
for (std::pair<RString const &, OptionRowHandler *> hand : m_Rows)
|
||||
delete hand.second;
|
||||
}
|
||||
|
||||
//This is the initialization function.
|
||||
@@ -200,8 +200,8 @@ void OptionsList::Load( RString sType, PlayerNumber pn )
|
||||
|
||||
vector<RString> asDirectLines;
|
||||
split( DIRECT_LINES, ",", asDirectLines, true );
|
||||
FOREACH( RString, asDirectLines, s )
|
||||
m_setDirectRows.insert( *s );
|
||||
for (RString &s : asDirectLines)
|
||||
m_setDirectRows.insert(s);
|
||||
|
||||
vector<RString> setToLoad;
|
||||
split( TOP_MENUS, ",", setToLoad );
|
||||
@@ -220,7 +220,7 @@ void OptionsList::Load( RString sType, PlayerNumber pn )
|
||||
ParseCommands( sRowCommands, cmds, false );
|
||||
|
||||
OptionRowHandler *pHand = OptionRowHandlerUtil::Make( cmds );
|
||||
if( pHand == NULL )
|
||||
if( pHand == nullptr )
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("Invalid OptionRowHandler '%s' in %s::Line%s", cmds.GetOriginalCommandString().c_str(), m_sName.c_str(), sLineName.c_str());
|
||||
continue;
|
||||
@@ -252,10 +252,9 @@ void OptionsList::Load( RString sType, PlayerNumber pn )
|
||||
void OptionsList::Reset()
|
||||
{
|
||||
/* Import options. */
|
||||
FOREACHM( RString, OptionRowHandler *, m_Rows, hand )
|
||||
for (std::pair<RString const &, OptionRowHandler *> hand : m_Rows)
|
||||
{
|
||||
RString sLineName = hand->first;
|
||||
ImportRow( sLineName );
|
||||
ImportRow(hand.first);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +271,7 @@ void OptionsList::Open()
|
||||
Push( TOP_MENU );
|
||||
|
||||
this->FinishTweening();
|
||||
m_Row[!m_iCurrentRow].SetFromHandler( NULL );
|
||||
m_Row[!m_iCurrentRow].SetFromHandler(nullptr);
|
||||
this->PlayCommand( "TweenOn" );
|
||||
}
|
||||
|
||||
@@ -532,7 +531,7 @@ void OptionsList::ImportRow( RString sRow )
|
||||
vpns.push_back( m_pn );
|
||||
OptionRowHandler *pHandler = m_Rows[sRow];
|
||||
aSelections[ m_pn ].resize( pHandler->m_Def.m_vsChoices.size() );
|
||||
pHandler->ImportOption( NULL, vpns, aSelections );
|
||||
pHandler->ImportOption( nullptr, vpns, aSelections );
|
||||
m_bSelections[sRow] = aSelections[ m_pn ];
|
||||
|
||||
if( m_setTopMenus.find(sRow) != m_setTopMenus.end() )
|
||||
@@ -641,7 +640,7 @@ void OptionsList::SelectionsChanged( const RString &sRowName )
|
||||
const OptionRowHandler *pHandler = m_Rows[sRowName];
|
||||
vector<bool> &bSelections = m_bSelections[sRowName];
|
||||
|
||||
if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != NULL )
|
||||
if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != nullptr )
|
||||
{
|
||||
vector<bool> &bLinkedSelections = m_pLinked->m_bSelections[sRowName];
|
||||
bLinkedSelections = bSelections;
|
||||
@@ -688,10 +687,10 @@ bool OptionsList::Start()
|
||||
GAMESTATE->ResetToDefaultSongOptions( ModsLevel_Preferred );
|
||||
|
||||
/* Import options. */
|
||||
FOREACHM( RString, OptionRowHandler *, m_Rows, hand )
|
||||
for (std::pair<RString const &, OptionRowHandler *> hand : m_Rows)
|
||||
{
|
||||
ImportRow( hand->first );
|
||||
SelectionsChanged( hand->first );
|
||||
ImportRow( hand.first );
|
||||
SelectionsChanged( hand.first );
|
||||
}
|
||||
|
||||
UpdateMenuFromSelections();
|
||||
|
||||
Reference in New Issue
Block a user