cleanup: "(PlayerNumber)" -> ""

This commit is contained in:
Chris Danford
2005-01-31 03:18:46 +00:00
parent 3674f5a507
commit a24bd3014c
18 changed files with 46 additions and 54 deletions
+4 -4
View File
@@ -573,10 +573,10 @@ void Background::Update( float fDeltaTime )
FOREACH_PlayerNumber( p )
{
if( IsDangerPlayerVisible((PlayerNumber)p) )
if( IsDangerPlayerVisible(p) )
m_DangerPlayer[p].Update( fDeltaTime );
if( IsDeadPlayerVisible((PlayerNumber)p) )
if( IsDeadPlayerVisible(p) )
m_DeadPlayer[p].Update( fDeltaTime );
}
@@ -628,9 +628,9 @@ void Background::DrawPrimitives()
FOREACH_PlayerNumber( p )
{
if( IsDangerPlayerVisible((PlayerNumber)p) )
if( IsDangerPlayerVisible(p) )
m_DangerPlayer[p].Draw();
if( IsDeadPlayerVisible((PlayerNumber)p) )
if( IsDeadPlayerVisible(p) )
m_DeadPlayer[p].Draw();
}
}
+3 -3
View File
@@ -136,7 +136,7 @@ void CombinedLifeMeterEnemy::Update( float fDelta )
a.sModifier = sPossibleModifiers[a.level][rand()%3];
FOREACH_PlayerNumber( p )
if( GAMESTATE->IsHumanPlayer(p) )
GAMESTATE->LaunchAttack( (PlayerNumber)p, a );
GAMESTATE->LaunchAttack( p, a );
SCREENMAN->SendMessageToTopScreen( SM_BattleTrickLevel1 );
SetFace( attack );
}
@@ -148,7 +148,7 @@ void CombinedLifeMeterEnemy::Update( float fDelta )
a.sModifier = sPossibleModifiers[a.level][rand()%3];
FOREACH_PlayerNumber( p )
if( GAMESTATE->IsHumanPlayer(p) )
GAMESTATE->LaunchAttack( (PlayerNumber)p, a );
GAMESTATE->LaunchAttack( p, a );
SCREENMAN->SendMessageToTopScreen( SM_BattleTrickLevel2 );
SetFace( attack );
}
@@ -160,7 +160,7 @@ void CombinedLifeMeterEnemy::Update( float fDelta )
a.sModifier = sPossibleModifiers[a.level][rand()%3];
FOREACH_PlayerNumber( p )
if( GAMESTATE->IsHumanPlayer(p) )
GAMESTATE->LaunchAttack( (PlayerNumber)p, a );
GAMESTATE->LaunchAttack( p, a );
SCREENMAN->SendMessageToTopScreen( SM_BattleTrickLevel3 );
SetFace( attack );
}
+4 -6
View File
@@ -11,16 +11,14 @@ DualScrollBar::DualScrollBar()
void DualScrollBar::Load()
{
int pn;
for( pn=0; pn < NUM_PLAYERS; ++pn )
FOREACH_PlayerNumber( pn )
{
m_sprScrollThumbUnderHalf[pn].SetName( ssprintf("ThumbP%i", pn+1) );
m_sprScrollThumbUnderHalf[pn].Load( THEME->GetPathToG( ssprintf("%s thumb p%i", m_sName.c_str(), pn+1) ) );
this->AddChild( &m_sprScrollThumbUnderHalf[pn] );
}
for( pn=0; pn < NUM_PLAYERS; ++pn )
FOREACH_PlayerNumber( pn )
{
m_sprScrollThumbOverHalf[pn].SetName( ssprintf("ThumbP%i", pn+1) );
m_sprScrollThumbOverHalf[pn].Load( THEME->GetPathToG( ssprintf("%s thumb p%i", m_sName.c_str(), pn+1) ) );
@@ -33,8 +31,8 @@ void DualScrollBar::Load()
m_sprScrollThumbOverHalf[0].SetCropRight( .5f );
m_sprScrollThumbOverHalf[1].SetCropLeft( .5f );
for( pn=0; pn < NUM_PLAYERS; ++pn )
SetPercentage( (PlayerNumber) pn, 0 );
FOREACH_PlayerNumber( pn )
SetPercentage( pn, 0 );
FinishTweening();
}
+3 -3
View File
@@ -447,7 +447,7 @@ void GameState::Update( float fDelta )
}
if( bRebuildPlayerOptions )
RebuildPlayerOptionsFromActiveAttacks( (PlayerNumber)p );
RebuildPlayerOptionsFromActiveAttacks( p );
if( m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut > 0 )
m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut = max( 0, m_pPlayerState[p]->m_fSecondsUntilAttacksPhasedOut - fDelta );
@@ -1119,7 +1119,7 @@ bool GameState::IsDisqualified( PlayerNumber pn )
void GameState::ResetNoteSkins()
{
FOREACH_PlayerNumber( pn )
ResetNoteSkinsForPlayer( (PlayerNumber) pn );
ResetNoteSkinsForPlayer( pn );
++m_BeatToNoteSkinRev;
}
@@ -1279,7 +1279,7 @@ void GameState::RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn )
void GameState::RemoveAllActiveAttacks() // called on end of song
{
FOREACH_PlayerNumber( p )
RemoveActiveAttacksForPlayer( (PlayerNumber)p );
RemoveActiveAttacksForPlayer( p );
}
int GameState::GetSumOfActiveAttackLevels( PlayerNumber pn ) const
+2 -2
View File
@@ -132,7 +132,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives()
//
// use a fan to draw the volume
//
RageColor color = PlayerToColor( (PlayerNumber)p );
RageColor color = PlayerToColor( p );
color.a = 0.5f;
v[0].p = RageVector3( 0, 0, 0 );
v[0].c = color;
@@ -165,7 +165,7 @@ void GrooveRadar::GrooveRadarValueMap::DrawPrimitives()
const float fY = -sinf(fRotation) * fDistFromCenter;
v[i].p = RageVector3( fX, fY, 0 );
v[i].c = PlayerToColor( (PlayerNumber)p );
v[i].c = PlayerToColor( p );
}
// TODO: Add this back in. -Chris
+2 -2
View File
@@ -195,12 +195,12 @@ void MusicWheelItem::RefreshGrades()
else
dc = GAMESTATE->m_PreferredDifficulty[p];
Grade grade;
if( PROFILEMAN->IsUsingProfile((PlayerNumber)p) )
if( PROFILEMAN->IsUsingProfile(p) )
grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), (ProfileSlot)p, dc ).grade;
else
grade = PROFILEMAN->GetHighScoreForDifficulty( data->m_pSong, GAMESTATE->GetCurrentStyle(), PROFILE_SLOT_MACHINE, dc ).grade;
m_GradeDisplay[p].SetGrade( (PlayerNumber)p, grade );
m_GradeDisplay[p].SetGrade( p, grade );
}
}
-5
View File
@@ -15,11 +15,6 @@ RageColor PlayerToColor( PlayerNumber pn )
}
};
RageColor PlayerToColor( int p )
{
return PlayerToColor( (PlayerNumber)p );
}
PlayerNumber GetNextHumanPlayer( PlayerNumber pn )
{
for( PlayerNumber p=(PlayerNumber)(pn+1); p<NUM_PLAYERS; ((int&)p)++ )
-1
View File
@@ -30,7 +30,6 @@ PlayerNumber GetNextPotentialCpuPlayer( PlayerNumber pn );
const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_2, PLAYER_1 };
RageColor PlayerToColor( PlayerNumber pn );
RageColor PlayerToColor( int p );
#endif
+2 -2
View File
@@ -424,7 +424,7 @@ void ScreenEvaluation::Init()
m_textPlayerOptions[p].SetText( sPO );
this->AddChild( &m_textPlayerOptions[p] );
if( GAMESTATE->IsDisqualified((PlayerNumber)p) )
if( GAMESTATE->IsDisqualified(p) )
{
m_sprDisqualified[p].Load( THEME->GetPathToG("ScreenEvaluation disqualified") );
m_sprDisqualified[p]->SetName( ssprintf("DisqualifiedP%d",p+1) );
@@ -486,7 +486,7 @@ void ScreenEvaluation::Init()
this->AddChild( m_sprGradeFrame[p] );
m_Grades[p].Load( THEME->GetPathToG("ScreenEvaluation grades") );
m_Grades[p].SetGrade( (PlayerNumber)p, grade[p] );
m_Grades[p].SetGrade( p, grade[p] );
m_Grades[p].SetName( ssprintf("GradeP%d",p+1) );
SET_XY_AND_ON_COMMAND( m_Grades[p] );
if( SPIN_GRADES )
+4 -4
View File
@@ -121,7 +121,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic( CString sName ) : ScreenWithMenuElem
this->AddChild(&m_debugtext);
#endif
for(int p=0; p<NUM_PLAYERS; p++ )
FOREACH_PlayerNumber( p )
{
// m_FootMeter[p].SetXY( METER_X(p), METER_Y(p) );
// m_FootMeter[p].SetShadowLength( 2 );
@@ -152,7 +152,7 @@ ScreenEz2SelectMusic::ScreenEz2SelectMusic( CString sName ) : ScreenWithMenuElem
m_VanishIcon[p].SetDiffuse( RageColor(0,0,0,0) );
this->AddChild(&m_VanishIcon[p] );
UpdateOptions((PlayerNumber) p,0);
UpdateOptions( p,0);
m_iSelection[p] = 0;
}
@@ -669,9 +669,9 @@ void ScreenEz2SelectMusic::MusicChanged()
m_iSelection[pn] = clamp( m_iSelection[pn], 0, int(m_arrayNotes[pn].size()) ) ;
}
for( pn=0; pn<NUM_PLAYERS; pn++ )
FOREACH_PlayerNumber( pn )
{
AfterNotesChange( (PlayerNumber)pn );
AfterNotesChange( pn );
}
}
+3 -3
View File
@@ -134,7 +134,7 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
// Find out if players deserve to enter their name
FOREACH_PlayerNumber( p )
{
GAMESTATE->GetRankingFeats( (PlayerNumber)p, aFeats[p] );
GAMESTATE->GetRankingFeats( p, aFeats[p] );
m_bStillEnteringName[p] = aFeats[p].size()>0;
}
@@ -162,7 +162,7 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName )
FOREACH_PlayerNumber( p )
{
// load last used ranking name if any
Profile* pProfile = PROFILEMAN->GetProfile((PlayerNumber)p);
Profile* pProfile = PROFILEMAN->GetProfile(p);
if( pProfile && !pProfile->m_sLastUsedHighScoreName.empty() )
m_sSelectedName[p] = pProfile->m_sLastUsedHighScoreName;
@@ -377,7 +377,7 @@ void ScreenNameEntry::HandleScreenMessage( const ScreenMessage SM )
if( !m_Out.IsTransitioning() )
{
FOREACH_PlayerNumber( p )
this->MenuStart( (PlayerNumber)p );
this->MenuStart( p );
}
break;
case SM_GoToNextScreen:
+1 -1
View File
@@ -181,7 +181,7 @@ void ScreenNetEvaluation::UpdateStats()
if( m_iCurrentPlayer >= (int) NSMAN->m_EvalPlayerData.size() )
return;
m_Grades[m_pActivePlayer].SetGrade( (PlayerNumber)m_pActivePlayer, (Grade)NSMAN->m_EvalPlayerData[m_iCurrentPlayer].grade );
m_Grades[m_pActivePlayer].SetGrade( m_pActivePlayer, (Grade)NSMAN->m_EvalPlayerData[m_iCurrentPlayer].grade );
m_Grades[m_pActivePlayer].Spin();
m_Grades[m_pActivePlayer].SettleImmediately();
+2 -2
View File
@@ -80,7 +80,7 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenNetSe
FOREACH_EnabledPlayer( p )
{
m_OptionIconRow[p].SetName( ssprintf("OptionIconsP%d",p+1) );
m_OptionIconRow[p].Load( (PlayerNumber)p );
m_OptionIconRow[p].Load( p );
m_OptionIconRow[p].Refresh();
SET_XY_AND_ON_COMMAND( m_OptionIconRow[p] );
this->AddChild( &m_OptionIconRow[p] );
@@ -259,7 +259,7 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
//Update changes
FOREACH_EnabledPlayer(p)
{
m_OptionIconRow[p].Load( (PlayerNumber)p );
m_OptionIconRow[p].Load( p );
m_OptionIconRow[p].Refresh();
}
break;
+11 -11
View File
@@ -227,7 +227,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
// init highlights
FOREACH_HumanPlayer( p )
{
m_Highlight[p].Load( (PlayerNumber)p, false );
m_Highlight[p].Load( p, false );
m_framePage.AddChild( &m_Highlight[p] );
}
@@ -238,7 +238,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
{
Row &row = *m_Rows[l];
LoadOptionIcon( (PlayerNumber)p, l, "" );
LoadOptionIcon( p, l, "" );
m_framePage.AddChild( &row.m_OptionIcons[p] );
}
}
@@ -278,7 +278,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
{
OptionsCursor *ul = new OptionsCursor;
row.m_Underline[p].push_back( ul );
ul->Load( (PlayerNumber)p, true );
ul->Load( p, true );
ul->SetX( fX );
ul->SetWidth( truncf(fItemWidth) );
}
@@ -387,7 +387,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
{
m_textPlayerName[p].LoadFromFont( THEME->GetPathToF( "ScreenOptions player") );
m_textPlayerName[p].SetName( ssprintf("PlayerNameP%i",p+1) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName((PlayerNumber)p) );
m_textPlayerName[p].SetText( GAMESTATE->GetPlayerDisplayName(p) );
SET_XY_AND_ON_COMMAND( m_textPlayerName[p] );
m_framePage.AddChild( &m_textPlayerName[p] );
}
@@ -399,7 +399,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
m_ScrollBar.SetBarHeight( SCROLL_BAR_HEIGHT );
m_ScrollBar.SetBarTime( SCROLL_BAR_TIME );
FOREACH_PlayerNumber( p )
m_ScrollBar.EnablePlayer( (PlayerNumber)p, GAMESTATE->IsHumanPlayer(p) );
m_ScrollBar.EnablePlayer( p, GAMESTATE->IsHumanPlayer(p) );
m_ScrollBar.Load();
SET_XY( m_ScrollBar );
m_framePage.AddChild( &m_ScrollBar );
@@ -452,7 +452,7 @@ void ScreenOptions::InitMenu( InputMode im, OptionRowData OptionRows[], int iNum
UpdateEnabledDisabled();
{
FOREACH_PlayerNumber( p )
OnChange( (PlayerNumber)p );
OnChange( p );
}
CHECKPOINT;
@@ -679,7 +679,7 @@ void ScreenOptions::PositionIcons()
int iChoiceWithFocus = row.m_iChoiceInRowWithFocus[p];
int iWidth, iX, iY; // We only use iY
GetWidthXY( (PlayerNumber)p, i, iChoiceWithFocus, iWidth, iX, iY );
GetWidthXY( p, i, iChoiceWithFocus, iWidth, iX, iY );
icon.SetX( ICONS_X(p) );
if( icon.GetDestY() != row.m_fY )
@@ -719,7 +719,7 @@ void ScreenOptions::PositionCursors()
const int iChoiceWithFocus = Row.m_iChoiceInRowWithFocus[pn];
int iWidth, iX, iY;
GetWidthXY( (PlayerNumber)pn, iRow, iChoiceWithFocus, iWidth, iX, iY );
GetWidthXY( pn, iRow, iChoiceWithFocus, iWidth, iX, iY );
highlight.SetBarWidth( iWidth );
highlight.SetXY( (float)iX, (float)iY );
}
@@ -1058,7 +1058,7 @@ void ScreenOptions::OnChange( PlayerNumber pn )
FOREACH_PlayerNumber( p )
{
if( GAMESTATE->IsHumanPlayer(p) )
TweenCursor( (PlayerNumber) p );
TweenCursor( p );
const bool ExitSelected = m_Rows[m_iCurrentRow[pn]]->Type == Row::ROW_EXIT;
if( p == pn || GAMESTATE->GetNumHumanPlayers() == 1 )
@@ -1318,7 +1318,7 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
if( optrow.type == OptionRowData::SELECT_MULTIPLE )
; // do nothing. User must press Start to toggle the selection.
else
row.SetOneSelection( (PlayerNumber)p, iNewChoiceWithFocus );
row.SetOneSelection( p, iNewChoiceWithFocus );
}
}
}
@@ -1397,7 +1397,7 @@ void ScreenOptions::MoveRow( PlayerNumber pn, int dir, bool Repeat )
}
}
OnChange( (PlayerNumber)p );
OnChange( p );
changed = true;
}
if( changed )
+1 -1
View File
@@ -121,7 +121,7 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller );
if( GAMESTATE->IsHumanPlayer(pn) && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) )
{
SOUND->PlayOnce( THEME->GetPathToS("ScreenPlayerOptions cancel all") );
SOUND->PlayOnce( THEME->GetPathS(m_sName,"cancel all") );
// apply the game default mods, but not the Profile saved mods
GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.Init();
+2 -2
View File
@@ -147,8 +147,8 @@ ScreenSelectCharacter::ScreenSelectCharacter( CString sClassName ) : ScreenWithM
{
if( GAMESTATE->IsHumanPlayer(p) )
{
AfterRowChange( (PlayerNumber)p );
AfterValueChange( (PlayerNumber)p );
AfterRowChange( p );
AfterValueChange( p );
}
for( unsigned i=0; i<MAX_CHAR_ICONS_TO_SHOW; i++ )
+1 -1
View File
@@ -239,7 +239,7 @@ ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : ScreenWithMenuEleme
this->AddChild( &m_AutoGenIcon[p] );
m_OptionIconRow[p].SetName( ssprintf("OptionIconsP%d",p+1) );
m_OptionIconRow[p].Load( (PlayerNumber)p );
m_OptionIconRow[p].Load( p );
m_OptionIconRow[p].Refresh();
SET_XY( m_OptionIconRow[p] );
this->AddChild( &m_OptionIconRow[p] );
+1 -1
View File
@@ -50,7 +50,7 @@ ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( s
{
FOREACH_PlayerNumber( p )
{
m_MemoryCardDisplay[p].Load( (PlayerNumber)p );
m_MemoryCardDisplay[p].Load( p );
m_MemoryCardDisplay[p].SetName( ssprintf("MemoryCardDisplayP%d",p+1) );
SET_XY_AND_ON_COMMAND( m_MemoryCardDisplay[p] );
this->AddChild( &m_MemoryCardDisplay[p] );