signs, headers, for scoping

This commit is contained in:
Glenn Maynard
2002-11-16 20:21:00 +00:00
parent c07730aa46
commit 984b433858
13 changed files with 44 additions and 33 deletions
+4 -4
View File
@@ -9,10 +9,10 @@
/* Fractions, 0/16 to 15/16: */
static const int DitherMat[DitherMatDim][DitherMatDim] =
{
0, 8, 2, 10,
12, 4, 14, 6,
3, 11, 1, 9,
15, 7, 13, 5
{ 0, 8, 2, 10 },
{ 12, 4, 14, 6 },
{ 3, 11, 1, 9 },
{ 15, 7, 13, 5 }
};
static int DitherMatCalc[DitherMatDim][DitherMatDim];
+6 -3
View File
@@ -101,7 +101,8 @@ ScreenGameplay::ScreenGameplay()
{
LOG->Trace( "ScreenGameplay::ScreenGameplay()" );
for( int p=0; p<NUM_PLAYERS; p++ )
int p;
for( p=0; p<NUM_PLAYERS; p++ )
{
m_pLifeMeter[p] = NULL;
m_pScoreDisplay[p] = NULL;
@@ -527,7 +528,8 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad )
case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS:
{
for( int p=0; p<NUM_PLAYERS; p++ )
int p;
for( p=0; p<NUM_PLAYERS; p++ )
{
m_textCourseSongNumber[p].SetText( ssprintf("%d", GAMESTATE->m_iSongsBeforeFail[p]+1) );
// If it's the first song, record the options the player selected for later.
@@ -1143,7 +1145,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
}
// save any statistics
for( int p=0; p<NUM_PLAYERS; p++ )
int p;
for( p=0; p<NUM_PLAYERS; p++ )
{
if( GAMESTATE->IsPlayerEnabled(p) )
{
+1 -1
View File
@@ -29,4 +29,4 @@ private:
void GoToPrevState();
};
#endif
#endif
+1 -1
View File
@@ -26,4 +26,4 @@ private:
void GoToPrevState();
};
#endif
#endif
+1 -1
View File
@@ -337,4 +337,4 @@ void ScreenManager::RefreshCreditsMessages()
else if( GAMESTATE->m_bPlayersCanJoin ) m_textCreditInfo[p].SetText( "PRESS START" );
else m_textCreditInfo[p].SetText( "CREDIT(S) 0 / 0" );
}
}
}
+7 -4
View File
@@ -74,7 +74,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
{
m_iCurrentRow[p] = 0;
for( int l=0; l<MAX_OPTION_LINES; l++ )
for( unsigned l=0; l<MAX_OPTION_LINES; l++ )
m_iSelectedOption[p][l] = 0;
}
@@ -102,7 +102,7 @@ void ScreenOptions::Init( InputMode im, OptionRowData OptionRowData[], int iNumO
this->ImportOptions();
if( m_InputMode == INPUTMODE_BOTH )
{
for( int l=0; l<MAX_OPTION_LINES; l++ )
for( unsigned l=0; l<MAX_OPTION_LINES; l++ )
m_iSelectedOption[PLAYER_2][l] = m_iSelectedOption[PLAYER_1][l];
}
@@ -127,6 +127,7 @@ void ScreenOptions::Init( InputMode im, OptionRowData OptionRowData[], int iNumO
}
// init text
int i;
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach line
{
m_framePage.AddChild( &m_sprLineArrows[i] );
@@ -178,7 +179,8 @@ void ScreenOptions::InitOptionsText()
const float fLineGap = ITEMS_SPACING_Y - max(0, (m_iNumOptionRows-10)*2);
// init m_textOptions from optionLines
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach options line
int i;
for( i=0; i<m_iNumOptionRows; i++ ) // foreach options line
{
OptionRowData &optline = m_OptionRowData[i];
@@ -358,7 +360,8 @@ void ScreenOptions::UpdateEnabledDisabled()
RageColor colorNotSelected = COLOR_NOT_SELECTED;
// init text
for( int i=0; i<m_iNumOptionRows; i++ ) // foreach line
int i;
for( i=0; i<m_iNumOptionRows; i++ ) // foreach line
{
bool bThisRowIsSelected = false;
for( int p=0; p<NUM_PLAYERS; p++ )
+1 -1
View File
@@ -29,4 +29,4 @@ private:
#endif
#endif
+1 -1
View File
@@ -86,4 +86,4 @@ void ScreenSandbox::HandleScreenMessage( const ScreenMessage SM )
case SM_DoneOpeningWipingRight:
break;
}
}
}
+10 -9
View File
@@ -86,7 +86,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
GAMESTATE->m_PlayMode = PLAY_MODE_INVALID;
int p;
unsigned p;
m_Menu.Load(
THEME->GetPathTo("BGAnimations","select difficulty"),
@@ -96,7 +96,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty()
this->AddChild( &m_Menu );
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
for( unsigned d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
CString sHeaderFile;
CString sPictureFile;
@@ -303,9 +303,9 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn )
bool ScreenSelectDifficulty::IsItemOnPage2( int iItemIndex )
{
ASSERT( iItemIndex >= 0 && iItemIndex < NUM_DIFFICULTY_ITEMS );
ASSERT( iItemIndex >= 0 && iItemIndex < unsigned(NUM_DIFFICULTY_ITEMS) );
return iItemIndex >= NUM_ITEMS_ON_PAGE_1;
return iItemIndex >= unsigned(NUM_ITEMS_ON_PAGE_1);
}
bool ScreenSelectDifficulty::SelectedSomethingOnPage2()
@@ -327,7 +327,8 @@ void ScreenSelectDifficulty::ChangeTo( PlayerNumber pn, int iSelectionWas, int i
bool bSelectedSomethingOnPage2 = iSelectionIs >= 3;
bool bSomeoneMadeAChoice = false;
for( int p=0; p<NUM_PLAYERS; p++ )
int p;
for( p=0; p<NUM_PLAYERS; p++ )
if( GAMESTATE->IsPlayerEnabled(p) && m_bChosen[p] )
bSomeoneMadeAChoice = true;
@@ -392,7 +393,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
return;
m_bChosen[pn] = true;
for( int page=0; page<NUM_PAGES; page++ )
for( unsigned page=0; page<NUM_PAGES; page++ )
m_sprMoreArrows[page].FadeOff( 0, "fade", 0.5f );
@@ -489,7 +490,7 @@ void ScreenSelectDifficulty::TweenOffScreen()
m_sprJoinMessagehadow[p].SetTweenDiffuse( RageColor(0,0,0,0) );
}
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
for( unsigned d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
if( SelectedSomethingOnPage2() != IsItemOnPage2(d) ) // item isn't on selected page
continue; // don't tween
@@ -518,7 +519,7 @@ void ScreenSelectDifficulty::TweenOffScreen()
void ScreenSelectDifficulty::TweenOnScreen()
{
int p;
unsigned p;
for( p=0; p<NUM_PAGES; p++ )
{
@@ -557,7 +558,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
m_sprJoinMessagehadow[p].SetTweenDiffuse( colorOriginal );
}
for( int d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
for( unsigned d=0; d<NUM_DIFFICULTY_ITEMS; d++ )
{
const float fPauseTime = d*0.2f;
+3 -2
View File
@@ -28,7 +28,7 @@ enum {
OptionRowData g_SelectGameLines[NUM_SELECT_GAME_LINES] =
{
"Game", 0, { "" }
{ "Game", 0, { "" } }
};
@@ -44,7 +44,8 @@ ScreenSelectGame::ScreenSelectGame() :
/* populate g_SelectGameLines */
CArray<Game,Game> aGames;
GAMEMAN->GetEnabledGames( aGames );
for( unsigned i=0; i<aGames.size(); i++ )
unsigned i;
for( i=0; i<aGames.size(); i++ )
{
Game game = aGames[i];
CString sGameName = GAMEMAN->GetGameDefForGame(game)->m_szName;
+6 -4
View File
@@ -120,8 +120,8 @@ ScreenSelectStyle5th::ScreenSelectStyle5th()
m_iSelection = 0; // single
for( int i=0; i<NUM_STYLE_PADS; i++ )
int i;
for( i=0; i<NUM_STYLE_PADS; i++ )
{
m_sprPad[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style pad game %d style %d",GAMESTATE->m_CurGame,i)) );
// m_sprPad[i].SetXY( PAD_X[i], PAD_Y[i] );
@@ -398,7 +398,8 @@ void ScreenSelectStyle5th::AfterChange()
void ScreenSelectStyle5th::TweenOffScreen()
{
for( int i=0; i<NUM_STYLE_DANCERS; i++ )
int i;
for( i=0; i<NUM_STYLE_DANCERS; i++ )
{
m_sprDancer[i].BeginTweening( MENU_ELEMENTS_TWEEN_TIME );
m_sprDancer[i].SetTweenZoomY( 0 );
@@ -423,7 +424,8 @@ void ScreenSelectStyle5th::TweenOffScreen()
void ScreenSelectStyle5th::TweenOnScreen()
{
for(int i=0; i<NUM_STYLE_DANCERS; i++ )
int i;
for(i=0; i<NUM_STYLE_DANCERS; i++ )
{
float fOrigDancerZoomY = m_sprDancer[i].GetZoomY();
m_sprDancer[i].SetZoomY( 0 );
+1 -1
View File
@@ -25,4 +25,4 @@ private:
void GoToPrevState();
};
#endif
#endif
+2 -1
View File
@@ -104,7 +104,8 @@ ScreenStage::ScreenStage()
this->AddChild( &m_sprSongBackground ); // add background first so it draws bottom-most
//this->AddChild( &m_quadMask ); // add quad mask before stage so that it will block out the stage sprites
for( int i=0; i<4; i++ )
int i;
for( i=0; i<4; i++ )
{
m_sprNumbers[i].Load( THEME->GetPathTo("Graphics","stage parts 5x3") );