diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index 4bdfa12fb8..b88a7c8624 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -50,7 +50,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) XNode xml; xml.m_sName = "Catalog"; - const vector &vStepsTypesToShow = STEPS_TYPES_TO_SHOW.GetValue(); + const vector &vStepsTypesToShow = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); { XNode* pNode = xml.AppendChild( "Totals" ); @@ -88,7 +88,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) iTotalSongs++; iNumSongsInGroup++; - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), dc ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) { Steps* pSteps = pSong->GetStepsByDifficulty( *st, *dc, false ); // no autogen if( pSteps == NULL ) @@ -169,7 +169,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) FOREACH_CONST( StepsType, vStepsTypesToShow, st ) { - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), dc ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) { Steps* pSteps = pSong->GetStepsByDifficulty( *st, *dc, false ); // no autogen if( pSteps == NULL ) @@ -218,7 +218,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) pCourseNode->AppendChild( "SubTitle", pCourse->GetDisplaySubTitle() ); pCourseNode->AppendChild( "HasMods", pCourse->HasMods() ); - const vector &vDiffs = COURSE_DIFFICULTIES_TO_SHOW.GetValue(); + const vector &vDiffs = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); FOREACH_CONST( StepsType, vStepsTypesToShow, st ) { @@ -248,7 +248,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) { XNode* pNode2 = pNode->AppendChild( "Difficulty" ); - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), iter ) { XNode* pNode3 = pNode2->AppendChild( "Difficulty", DifficultyToString(*iter) ); pNode3->AppendAttr( "DisplayAs", DifficultyToThemedString(*iter) ); @@ -257,7 +257,7 @@ void SaveCatalogXml( LoadingWindow *loading_window ) { XNode* pNode2 = pNode->AppendChild( "CourseDifficulty" ); - FOREACH_CONST( CourseDifficulty, COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter ) + FOREACH_CONST( CourseDifficulty, CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter ) { XNode* pNode3 = pNode2->AppendChild( "CourseDifficulty", CourseDifficultyToString(*iter) ); pNode3->AppendAttr( "DisplayAs", CourseDifficultyToThemedString(*iter) ); diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index fdad67795b..5a6b609de1 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -9,17 +9,17 @@ static CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%dCommand",int(p+1)); } -ThemeMetric INITIAL_SCREEN ("Common","InitialScreen", true); // always reevaluate metric -ThemeMetric FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); -ThemeMetric DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); -ThemeMetric DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); -ThemeMetric1D PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS); -ThemeMetric WINDOW_TITLE ("Common","WindowTitle"); -ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS ("Common","MaxCourseEntriesBeforeShowVarious"); -ThemeMetric TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); -ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); -ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow"); -ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); +ThemeMetric CommonMetrics::INITIAL_SCREEN ("Common","InitialScreen", true); // always reevaluate metric +ThemeMetric CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen"); +ThemeMetric CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); +ThemeMetric CommonMetrics::DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); +ThemeMetric1D CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS); +ThemeMetric CommonMetrics::WINDOW_TITLE ("Common","WindowTitle"); +ThemeMetric CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS("Common","MaxCourseEntriesBeforeShowVarious"); +ThemeMetric CommonMetrics::TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); +ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); +ThemeMetricCourseDifficultiesToShow CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow"); +ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const CString& sGroup, const CString& sName ) : @@ -121,7 +121,7 @@ void ThemeMetricStepsTypesToShow::Read() const vector& ThemeMetricStepsTypesToShow::GetValue() { return m_v; } -CString THEME_OPTION_ITEM( CString s, bool bOptional ) +CString CommonMetrics::ThemeOptionItem( CString s, bool bOptional ) { if( bOptional && !THEME->HasMetric("OptionNames",s) ) return s; diff --git a/stepmania/src/CommonMetrics.h b/stepmania/src/CommonMetrics.h index d3fbe62b66..6c4903edaf 100644 --- a/stepmania/src/CommonMetrics.h +++ b/stepmania/src/CommonMetrics.h @@ -47,20 +47,22 @@ private: // // Metrics // -extern ThemeMetric INITIAL_SCREEN; -extern ThemeMetric FIRST_ATTRACT_SCREEN; -extern ThemeMetric DEFAULT_MODIFIERS; -extern ThemeMetric DEFAULT_CPU_MODIFIERS; -extern ThemeMetric1D PLAYER_COLOR; -extern ThemeMetric WINDOW_TITLE; -extern ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS; -extern ThemeMetric TICK_EARLY_SECONDS; -extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; -extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW; -extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; - -CString THEME_OPTION_ITEM( CString s, bool bOptional ); +namespace CommonMetrics +{ + extern ThemeMetric INITIAL_SCREEN; + extern ThemeMetric FIRST_ATTRACT_SCREEN; + extern ThemeMetric DEFAULT_MODIFIERS; + extern ThemeMetric DEFAULT_CPU_MODIFIERS; + extern ThemeMetric1D PLAYER_COLOR; + extern ThemeMetric WINDOW_TITLE; + extern ThemeMetric MAX_COURSE_ENTRIES_BEFORE_VARIOUS; + extern ThemeMetric TICK_EARLY_SECONDS; + extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; + extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW; + extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; + CString ThemeOptionItem( CString s, bool bOptional ); +}; #endif diff --git a/stepmania/src/DifficultyList.cpp b/stepmania/src/DifficultyList.cpp index 3950ce3752..550884156a 100644 --- a/stepmania/src/DifficultyList.cpp +++ b/stepmania/src/DifficultyList.cpp @@ -258,7 +258,7 @@ void DifficultyList::SetFromGameState() // it really should round to the nearest difficulty that's in // DIFFICULTIES_TO_SHOW. unsigned i=0; - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d ) { m_Rows.resize( m_Rows.size()+1 ); diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index aeb6d82ce1..af2f50ac12 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -182,7 +182,7 @@ void EditMenu::Load( const CString &sType ) // fill in data structures // GetGroupsToShow( m_sGroups ); - m_StepsTypes = STEPS_TYPES_TO_SHOW.GetValue(); + m_StepsTypes = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); RefreshAll(); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index e780172bd4..41e73c0a1b 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -243,7 +243,7 @@ void GameState::Reset() // The theme setting is for eg. BM being reverse by default. (This // could be done in the title menu GameCommand, but then it wouldn't // affect demo, and other non-gameplay things ...) -glenn - ApplyModifiers( p, DEFAULT_MODIFIERS ); + ApplyModifiers( p, CommonMetrics::DEFAULT_MODIFIERS ); ApplyModifiers( p, PREFSMAN->GetCurrentGamePrefs().m_sDefaultModifiers ); } @@ -382,7 +382,7 @@ void GameState::PlayersFinalized() } FOREACH_PotentialCpuPlayer( pn ) - ApplyModifiers( pn, DEFAULT_CPU_MODIFIERS ); + ApplyModifiers( pn, CommonMetrics::DEFAULT_CPU_MODIFIERS ); } void GameState::EndGame() @@ -1673,7 +1673,7 @@ bool GameState::IsTimeToPlayAttractSounds() const void GameState::VisitAttractScreen( const CString sScreenName ) { - if( sScreenName == FIRST_ATTRACT_SCREEN.GetValue() ) + if( sScreenName == CommonMetrics::FIRST_ATTRACT_SCREEN.GetValue() ) m_iNumTimesThroughAttract++; } @@ -1701,7 +1701,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, Difficulty dc ) bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir ) { - const vector &v = DIFFICULTIES_TO_SHOW.GetValue(); + const vector &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); Difficulty d = m_PreferredDifficulty[pn]; while( 1 ) @@ -1733,7 +1733,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir ) /* If we have a course selected, only choose among difficulties available in the course. */ const Course *pCourse = this->m_pCurCourse; - const vector &v = COURSE_DIFFICULTIES_TO_SHOW.GetValue(); + const vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); CourseDifficulty cd = m_PreferredCourseDifficulty[pn]; while( 1 ) @@ -1752,7 +1752,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir ) bool GameState::IsCourseDifficultyShown( CourseDifficulty cd ) { - const vector &v = COURSE_DIFFICULTIES_TO_SHOW.GetValue(); + const vector &v = CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(); return find(v.begin(), v.end(), cd) != v.end(); } diff --git a/stepmania/src/GrooveRadar.cpp b/stepmania/src/GrooveRadar.cpp index 8104f9570c..3cc11b9568 100644 --- a/stepmania/src/GrooveRadar.cpp +++ b/stepmania/src/GrooveRadar.cpp @@ -30,7 +30,7 @@ GrooveRadar::GrooveRadar() { m_GrooveRadarValueMap[p].SetRadius( m_sprRadarBase.GetZoomedWidth() ); m_Frame.AddChild( &m_GrooveRadarValueMap[p] ); - m_GrooveRadarValueMap[p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_GrooveRadarValueMap[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); } this->AddChild( &m_Frame ); diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index f900e845ff..ca4db493ed 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -56,7 +56,7 @@ static void GetUsedGameInputs( vector &vGameInputsOut ) GAMEMAN->GetStylesForGame( GAMESTATE->m_pCurGame, vStyles ); FOREACH( const Style*, vStyles, style ) { - bool bFound = find( STEPS_TYPES_TO_SHOW.GetValue().begin(), STEPS_TYPES_TO_SHOW.GetValue().end(), (*style)->m_StepsType ) != STEPS_TYPES_TO_SHOW.GetValue().end(); + bool bFound = find( CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().begin(), CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end(), (*style)->m_StepsType ) != CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue().end(); if( !bFound ) continue; FOREACH_PlayerNumber( pn ) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index d381a74fca..d4987980aa 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -41,7 +41,7 @@ void OptionRow::PrepareItemText( CString &s ) const if( m_pParentType->THEME_ITEMS && m_RowDef.m_bAllowThemeItems ) bTheme = true; if( bTheme ) - s = THEME_OPTION_ITEM( s, false ); + s = CommonMetrics::ThemeOptionItem( s, false ); if( m_pParentType->CAPITALIZE_ALL_OPTION_NAMES ) s.MakeUpper(); } @@ -195,7 +195,7 @@ CString OptionRow::GetRowTitle() const Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber]; ASSERT( pTrail != NULL ); const int iNumCourseEntries = pTrail->m_vEntries.size(); - if( iNumCourseEntries > MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) + if( iNumCourseEntries > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) bShowBpmInSpeedTitle = false; } diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 1708d7707c..16a0980299 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -460,7 +460,7 @@ public: ListEntries.push_back( mc ); } - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d ) { CString s = DifficultyToThemedString( *d ); @@ -932,7 +932,7 @@ public: defOut.m_bAllowThemeItems = false; // we theme the text ourself // calculate which StepsTypes to show - m_vStepsTypesToShow = STEPS_TYPES_TO_SHOW.GetValue(); + m_vStepsTypesToShow = CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(); FOREACH_CONST( StepsType, m_vStepsTypesToShow, st ) { diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index 585da910a4..dea216e812 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -639,7 +639,7 @@ void PlayerOptions::GetThemedMods( vector &AddTo ) const /* Theme the mod name (the last string). Allow this to not exist, since * characters might use modifiers that don't exist in the theme. */ - asTokens.back() = THEME_OPTION_ITEM( asTokens.back(), true ); + asTokens.back() = CommonMetrics::ThemeOptionItem( asTokens.back(), true ); CString sThemedMod = join( " ", asTokens ); diff --git a/stepmania/src/ScoreDisplayLifeTime.cpp b/stepmania/src/ScoreDisplayLifeTime.cpp index 337dd509d0..9b73a3f1ca 100644 --- a/stepmania/src/ScoreDisplayLifeTime.cpp +++ b/stepmania/src/ScoreDisplayLifeTime.cpp @@ -36,7 +36,7 @@ void ScoreDisplayLifeTime::Init( const PlayerState* pPlayerState, const PlayerSt m_textTimeRemaining.SetName( "TimeRemaining" ); this->AddChild( &m_textTimeRemaining ); ActorUtil::OnCommand( m_textTimeRemaining, sType ); - m_textTimeRemaining.RunCommands( PLAYER_COLOR.GetValue(pn) ); + m_textTimeRemaining.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) ); m_textDeltaSeconds.LoadFromFont( THEME->GetPathF(sType,"DeltaSeconds") ); m_textDeltaSeconds.SetName( "DeltaSeconds" ); diff --git a/stepmania/src/ScoreDisplayNormal.cpp b/stepmania/src/ScoreDisplayNormal.cpp index 4336a4d321..e502d405b2 100644 --- a/stepmania/src/ScoreDisplayNormal.cpp +++ b/stepmania/src/ScoreDisplayNormal.cpp @@ -31,7 +31,7 @@ void ScoreDisplayNormal::Init( const PlayerState* pPlayerState, const PlayerStag // TODO: Remove use of PlayerNumber. PlayerNumber pn = pPlayerState->m_PlayerNumber; - m_text.RunCommands( PLAYER_COLOR.GetValue(pn) ); + m_text.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) ); } void ScoreDisplayNormal::SetScore( int iNewScore ) diff --git a/stepmania/src/ScoreDisplayOni.cpp b/stepmania/src/ScoreDisplayOni.cpp index 3975fffee5..a5f5f7eea5 100644 --- a/stepmania/src/ScoreDisplayOni.cpp +++ b/stepmania/src/ScoreDisplayOni.cpp @@ -31,7 +31,7 @@ void ScoreDisplayOni::Init( const PlayerState* pPlayerState, const PlayerStageSt // TODO: Remove use of PlayerNumber. PlayerNumber pn = pPlayerState->m_PlayerNumber; - m_text.RunCommands( PLAYER_COLOR.GetValue(pn) ); + m_text.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) ); } diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 708fa2bafa..5cd2206fa7 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -736,7 +736,7 @@ void ScreenEdit::PlayTicks() * ahead. This is just to make sure that we request the sound early enough for it to * come out on time; the actual precise timing is handled by SetStartTime. */ float fPositionSeconds = GAMESTATE->m_fMusicSeconds; - fPositionSeconds += SOUND->GetPlayLatency() + (float)TICK_EARLY_SECONDS + 0.250f; + fPositionSeconds += SOUND->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f; const float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ); const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) ); @@ -760,7 +760,7 @@ void ScreenEdit::PlayTicks() fSecondsUntil /= m_soundMusic.GetPlaybackRate(); /* 2x music rate means the time until the tick is halved */ RageSoundParams p; - p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS); + p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)CommonMetrics::TICK_EARLY_SECONDS); m_soundAssistTick.Play( &p ); } } diff --git a/stepmania/src/ScreenEnding.cpp b/stepmania/src/ScreenEnding.cpp index ab9e3f2663..14ef1ad37d 100644 --- a/stepmania/src/ScreenEnding.cpp +++ b/stepmania/src/ScreenEnding.cpp @@ -78,7 +78,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) if( GAMESTATE->IsCourseMode() ) { - FOREACH_CONST( CourseDifficulty, COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter ) + FOREACH_CONST( CourseDifficulty, CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter ) { fActual += pProfile->GetCoursesActual(st,*iter); fPossible += pProfile->GetCoursesPossible(st,*iter); @@ -86,7 +86,7 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line ) } else { - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), iter ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), iter ) { fActual += pProfile->GetSongsActual(st,*iter); fPossible += pProfile->GetSongsPossible(st,*iter); diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index c4ed53f01c..c2813872bc 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -489,7 +489,7 @@ void ScreenEvaluation::Init() { m_textJudgeNumbers[l][p].LoadFromFont( THEME->GetPathF(m_sName, "judge") ); m_textJudgeNumbers[l][p].SetShadowLength( 0 ); - m_textJudgeNumbers[l][p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textJudgeNumbers[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textJudgeNumbers[l][p].SetName( JudgeLineToString(l)+ssprintf("NumberP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textJudgeNumbers[l][p] ); this->AddChild( &m_textJudgeNumbers[l][p] ); @@ -533,7 +533,7 @@ void ScreenEvaluation::Init() FOREACH_EnabledPlayer( p ) { m_textStatsText[l][p].LoadFromFont( THEME->GetPathF(m_sName,"stats") ); - m_textStatsText[l][p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textStatsText[l][p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textStatsText[l][p].SetName( StatLineToString(l)+ssprintf("TextP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textStatsText[l][p] ); this->AddChild( &m_textStatsText[l][p] ); @@ -564,7 +564,7 @@ void ScreenEvaluation::Init() { m_textScore[p].LoadFromFont( THEME->GetPathF(m_sName, "score") ); m_textScore[p].SetShadowLength( 0 ); - m_textScore[p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textScore[p].SetName( ssprintf("ScoreNumberP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textScore[p] ); m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, STATSMAN->m_CurStageStats.m_player[p].iScore) ); @@ -589,7 +589,7 @@ void ScreenEvaluation::Init() m_textTotalScore[p].LoadFromFont( THEME->GetPathF(m_sName, "totalscore") ); m_textTotalScore[p].SetShadowLength( 0 ); - m_textTotalScore[p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textTotalScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textTotalScore[p].SetName( ssprintf("TotalScoreNumberP%d",p+1) ); m_textTotalScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS+2, iTotalScore) ); SET_XY_AND_ON_COMMAND( m_textTotalScore[p] ); @@ -612,7 +612,7 @@ void ScreenEvaluation::Init() { m_textTime[p].LoadFromFont( THEME->GetPathF(m_sName, "time") ); m_textTime[p].SetShadowLength( 0 ); - m_textTime[p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textTime[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); m_textTime[p].SetName( ssprintf("TimeNumberP%d",p+1) ); SET_XY_AND_ON_COMMAND( m_textTime[p] ); m_textTime[p].SetText( SecondsToMMSSMsMs(STATSMAN->m_CurStageStats.m_player[p].fAliveSeconds) ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index ea5e646aef..d455d1f3d2 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -913,7 +913,7 @@ void ScreenGameplay::InitSongQueues() // In a survuval course, override stored mods if( pCourse->GetCourseType() == COURSE_TYPE_SURVIVAL ) - a.push_back( Attack(ATTACK_LEVEL_1, 0, 0, "clearall,"+DEFAULT_MODIFIERS.GetValue(), false, true, false) ); // don't show in AttackList + a.push_back( Attack(ATTACK_LEVEL_1, 0, 0, "clearall,"+CommonMetrics::DEFAULT_MODIFIERS.GetValue(), false, true, false) ); // don't show in AttackList e->GetAttackArray( a ); pi->m_asModifiersQueue.push_back( a ); @@ -1434,7 +1434,7 @@ void ScreenGameplay::PlayTicks() * ahead. This is just to make sure that we request the sound early enough for it to * come out on time; the actual precise timing is handled by SetStartTime. */ float fPositionSeconds = GAMESTATE->m_fMusicSeconds; - fPositionSeconds += SOUND->GetPlayLatency() + (float)TICK_EARLY_SECONDS + 0.250f; + fPositionSeconds += SOUND->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f; const float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ); const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) ); @@ -1459,7 +1459,7 @@ void ScreenGameplay::PlayTicks() fSecondsUntil /= GAMESTATE->m_SongOptions.m_fMusicRate; /* 2x music rate means the time until the tick is halved */ RageSoundParams p; - p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)TICK_EARLY_SECONDS); + p.m_StartTime = GAMESTATE->m_LastBeatUpdate + (fSecondsUntil - (float)CommonMetrics::TICK_EARLY_SECONDS); m_soundAssistTick.Play( &p ); } } diff --git a/stepmania/src/ScreenOptionsEditCourseEntry.cpp b/stepmania/src/ScreenOptionsEditCourseEntry.cpp index 4812199ca5..a2576eba80 100644 --- a/stepmania/src/ScreenOptionsEditCourseEntry.cpp +++ b/stepmania/src/ScreenOptionsEditCourseEntry.cpp @@ -90,7 +90,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen() def.m_sName = "Base Difficulty"; def.m_vsChoices.clear(); def.m_vsChoices.push_back( "(any)" ); - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), dc ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) def.m_vsChoices.push_back( DifficultyToThemedString(*dc) ); vDefs.push_back( def ); vHands.push_back( NULL ); @@ -268,10 +268,10 @@ void ScreenOptionsEditCourseEntry::ImportOptions( int iRow, const vector::const_iterator iter = find( DIFFICULTIES_TO_SHOW.GetValue().begin(), DIFFICULTIES_TO_SHOW.GetValue().end(), ce.baseDifficulty ); + vector::const_iterator iter = find( CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().begin(), CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().end(), ce.baseDifficulty ); int iChoice = 0; - if( iter != DIFFICULTIES_TO_SHOW.GetValue().end() ) - iChoice = iter - DIFFICULTIES_TO_SHOW.GetValue().begin() + 1; + if( iter != CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().end() ) + iChoice = iter - CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue().begin() + 1; OptionRow &row = *m_pRows[ROW_BASE_DIFFICULTY]; row.SetOneSharedSelection( iChoice ); } @@ -346,7 +346,7 @@ void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vector v; { - FOREACH_CONST( StepsType, STEPS_TYPES_TO_SHOW.GetValue(), st ) + FOREACH_CONST( StepsType, CommonMetrics::STEPS_TYPES_TO_SHOW.GetValue(), st ) { - FOREACH_CONST( CourseDifficulty, COURSE_DIFFICULTIES_TO_SHOW.GetValue(), cd ) + FOREACH_CONST( CourseDifficulty, CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(), cd ) { StepsTypeAndDifficulty stad = { *st, *cd }; v.push_back( stad ); diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index aee76f28f6..34c1ca8dea 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -207,7 +207,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) if( m_iChangeMask & OPT_RESET_GAME ) { ResetGame(); - SCREENMAN->SetNewScreen( INITIAL_SCREEN ); + SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN ); m_bExportWillSetANewScreen = false; } diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 3b7300b533..221f8c334d 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -214,7 +214,7 @@ void ScoreScroller::SetStepsType( StepsType st, RageColor color ) { ScoreRowItem *pItem = (ScoreRowItem *) m_SubActors[s]; - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), cd ) + FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), cd ) pItem->m_textScore[*cd].SetDiffuse( color ); } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 328c44343a..a856d17af3 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -261,7 +261,7 @@ void ScreenSelectMusic::Init() m_textHighScore[p].SetName( ssprintf("ScoreP%d",p+1) ); m_textHighScore[p].LoadFromFont( THEME->GetPathF(m_sName,"score") ); m_textHighScore[p].SetShadowLength( 0 ); - m_textHighScore[p].RunCommands( PLAYER_COLOR.GetValue(p) ); + m_textHighScore[p].RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(p) ); SET_XY( m_textHighScore[p] ); this->AddChild( &m_textHighScore[p] ); } @@ -1670,7 +1670,7 @@ void ScreenSelectMusic::AfterMusicChange() if( g_sBannerPath.empty() ) m_Banner.LoadFallback(); - if( (int)pTrail->m_vEntries.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) + if( (int)pTrail->m_vEntries.size() > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) m_BPMDisplay.SetVarious(); else m_BPMDisplay.SetBpmFromCourse( pCourse ); @@ -1762,7 +1762,7 @@ void ScreenSelectMusic::AfterMusicChange() g_StartedLoadingAt.Touch(); - if( (int) m_Artists.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) + if( (int) m_Artists.size() > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) { m_Artists.clear(); m_AltArtists.clear(); diff --git a/stepmania/src/ScreenTest.cpp b/stepmania/src/ScreenTest.cpp index 7d8d096f4d..a0e1a9f34d 100644 --- a/stepmania/src/ScreenTest.cpp +++ b/stepmania/src/ScreenTest.cpp @@ -62,7 +62,7 @@ void ScreenTest::Input( const InputEventPlus &input ) if( input.DeviceI.button == KEY_ESC ) { if( input.type != IET_FIRST_PRESS ) return; - SCREENMAN->SetNewScreen( INITIAL_SCREEN ); + SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN ); return; } } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 278311f332..06bb9d6931 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -100,7 +100,7 @@ static RageDisplay::VideoModeParams GetCurVideoModeParams() PREFSMAN->m_bSmoothLines, PREFSMAN->m_bTrilinearFiltering, PREFSMAN->m_bAnisotropicFiltering, - WINDOW_TITLE, + CommonMetrics::WINDOW_TITLE, THEME->GetPathG("Common","window icon"), PREFSMAN->m_bPAL, PREFSMAN->m_fDisplayAspectRatio @@ -1131,7 +1131,7 @@ int main(int argc, char* argv[]) /* Now that GAMESTATE is reset, tell SCREENMAN to update the theme (load * overlay screens and global sounds), and load the initial screen. */ SCREENMAN->ThemeChanged(); - SCREENMAN->SetNewScreen( INITIAL_SCREEN ); + SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN ); CodeDetector::RefreshCacheItems();