Trying to trace a rare ScreenOptions::Init crash.

This commit is contained in:
Glenn Maynard
2003-09-30 22:14:19 +00:00
parent 467608c75c
commit 939a92424e
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -77,18 +77,21 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
{ {
LOG->Trace( "ScreenOptions::Set()" ); LOG->Trace( "ScreenOptions::Set()" );
CHECKPOINT;
m_InputMode = im; m_InputMode = im;
m_OptionRow = OptionRows; m_OptionRow = OptionRows;
m_iNumOptionRows = iNumOptionLines; m_iNumOptionRows = iNumOptionLines;
m_bLoadExplanations = bLoadExplanations; m_bLoadExplanations = bLoadExplanations;
CHECKPOINT;
this->ImportOptions(); this->ImportOptions();
for( unsigned l=0; l<MAX_OPTION_LINES; l++ ) for( unsigned l=0; l<MAX_OPTION_LINES; l++ )
if( m_OptionRow[l].bOneChoiceForAllPlayers ) if( m_OptionRow[l].bOneChoiceForAllPlayers )
m_iSelectedOption[PLAYER_2][l] = m_iSelectedOption[PLAYER_1][l]; m_iSelectedOption[PLAYER_2][l] = m_iSelectedOption[PLAYER_1][l];
CHECKPOINT;
int p; int p;
@@ -103,6 +106,8 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
m_framePage.AddChild( &m_Highlight[p] ); m_framePage.AddChild( &m_Highlight[p] );
} }
CHECKPOINT;
// init underlines // init underlines
for( p=0; p<NUM_PLAYERS; p++ ) for( p=0; p<NUM_PLAYERS; p++ )
{ {
@@ -119,6 +124,8 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
} }
} }
CHECKPOINT;
// init m_textItems from optionLines // init m_textItems from optionLines
int r; int r;
for( r=0; r<m_iNumOptionRows; r++ ) // foreach line for( r=0; r<m_iNumOptionRows; r++ ) // foreach line
@@ -189,8 +196,10 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
m_framePage.AddChild( textItems[c] ); m_framePage.AddChild( textItems[c] );
} }
CHECKPOINT;
InitOptionsText(); InitOptionsText();
CHECKPOINT;
// TRICKY: Add one more item. This will be "EXIT" // TRICKY: Add one more item. This will be "EXIT"
{ {
BitmapText *bt = new BitmapText; BitmapText *bt = new BitmapText;
@@ -213,6 +222,7 @@ void ScreenOptions::Init( InputMode im, OptionRow OptionRows[], int iNumOptionLi
m_textExplanation.SetShadowLength( 0 ); m_textExplanation.SetShadowLength( 0 );
m_framePage.AddChild( &m_textExplanation ); m_framePage.AddChild( &m_textExplanation );
CHECKPOINT;
PositionItems(); PositionItems();
PositionUnderlines(); PositionUnderlines();
+2
View File
@@ -273,6 +273,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
ASSERT( (int) OptionRowHandlers.size() == NumRows ); ASSERT( (int) OptionRowHandlers.size() == NumRows );
CHECKPOINT;
Init( im, m_OptionRowAlloc, NumRows, Explanations ); Init( im, m_OptionRowAlloc, NumRows, Explanations );
} }
@@ -360,6 +361,7 @@ int ScreenOptionsMaster::ImportOption( const OptionRow &row, const OptionRowHand
void ScreenOptionsMaster::ImportOptions() void ScreenOptionsMaster::ImportOptions()
{ {
CHECKPOINT;
for( unsigned i = 0; i < OptionRowHandlers.size(); ++i ) for( unsigned i = 0; i < OptionRowHandlers.size(); ++i )
{ {
const OptionRowHandler &hand = OptionRowHandlers[i]; const OptionRowHandler &hand = OptionRowHandlers[i];