Integrate C++11 branch into 5_1-new
This commit is contained in:
+12
-13
@@ -233,16 +233,15 @@ void ScreenOptions::InitMenu( const vector<OptionRowHandler*> &vHands )
|
||||
|
||||
m_frameContainer.SortByDrawOrder();
|
||||
|
||||
FOREACH( OptionRow*, m_pRows, p )
|
||||
int iIndex = 0;
|
||||
for (OptionRow *p : m_pRows)
|
||||
{
|
||||
int iIndex = p - m_pRows.begin();
|
||||
|
||||
Lua *L = LUA->Get();
|
||||
LuaHelpers::Push( L, iIndex );
|
||||
(*p)->m_pLuaInstance->Set( L, "iIndex" );
|
||||
LuaHelpers::Push( L, iIndex++ );
|
||||
p->m_pLuaInstance->Set( L, "iIndex" );
|
||||
LUA->Release( L );
|
||||
|
||||
(*p)->RunCommands( ROW_INIT_COMMAND );
|
||||
p->RunCommands( ROW_INIT_COMMAND );
|
||||
}
|
||||
|
||||
// poke once at all the explanation metrics so that we catch missing ones early
|
||||
@@ -338,8 +337,8 @@ void ScreenOptions::TweenOnScreen()
|
||||
{
|
||||
ScreenWithMenuElements::TweenOnScreen();
|
||||
|
||||
FOREACH( OptionRow*, m_pRows, p )
|
||||
(*p)->RunCommands( ROW_ON_COMMAND );
|
||||
for (OptionRow *p : m_pRows)
|
||||
p->RunCommands( ROW_ON_COMMAND );
|
||||
|
||||
m_frameContainer.SortByDrawOrder();
|
||||
}
|
||||
@@ -348,8 +347,8 @@ void ScreenOptions::TweenOffScreen()
|
||||
{
|
||||
ScreenWithMenuElements::TweenOffScreen();
|
||||
|
||||
FOREACH( OptionRow*, m_pRows, p )
|
||||
(*p)->RunCommands( ROW_OFF_COMMAND );
|
||||
for (OptionRow *p : m_pRows)
|
||||
p->RunCommands( ROW_OFF_COMMAND );
|
||||
}
|
||||
|
||||
ScreenOptions::~ScreenOptions()
|
||||
@@ -594,7 +593,7 @@ void ScreenOptions::PositionRows( bool bTween )
|
||||
int P2Choice = GAMESTATE->IsHumanPlayer(PLAYER_2)? m_iCurrentRow[PLAYER_2]: m_iCurrentRow[PLAYER_1];
|
||||
|
||||
vector<OptionRow*> Rows( m_pRows );
|
||||
OptionRow *pSeparateExitRow = NULL;
|
||||
OptionRow *pSeparateExitRow = nullptr;
|
||||
|
||||
if( (bool)SEPARATE_EXIT_ROW && !Rows.empty() && Rows.back()->GetRowType() == OptionRow::RowType_Exit )
|
||||
{
|
||||
@@ -758,7 +757,7 @@ void ScreenOptions::AfterChangeValueOrRow( PlayerNumber pn )
|
||||
}
|
||||
|
||||
const RString text = GetExplanationText( iCurRow );
|
||||
BitmapText *pText = NULL;
|
||||
BitmapText *pText = nullptr;
|
||||
switch( m_InputMode )
|
||||
{
|
||||
case INPUTMODE_INDIVIDUAL:
|
||||
@@ -1015,7 +1014,7 @@ RString ScreenOptions::GetNextScreenForFocusedItem( PlayerNumber pn ) const
|
||||
return RString();
|
||||
|
||||
const OptionRowHandler *pHand = pRow->GetHandler();
|
||||
if( pHand == NULL )
|
||||
if( pHand == nullptr )
|
||||
return RString();
|
||||
return pHand->GetScreen( iChoice );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user