From 99a02deffe6138827e8f4708d3680c9249ce51f3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 24 May 2004 03:32:56 +0000 Subject: [PATCH] name cleanup: "StepsType nt" -> "StepsType st" --- stepmania/src/Course.cpp | 53 +++++++------- stepmania/src/Course.h | 8 +-- stepmania/src/GameManager.cpp | 20 +++--- stepmania/src/GameManager.h | 8 +-- stepmania/src/GameState.cpp | 20 +++--- stepmania/src/GameState.h | 1 + stepmania/src/ProfileManager.h | 4 +- stepmania/src/ScreenEditMenu.cpp | 10 +-- stepmania/src/ScreenEvaluation.cpp | 6 +- stepmania/src/ScreenNameEntryTraditional.cpp | 48 ++++++------- stepmania/src/ScreenRanking.cpp | 6 +- stepmania/src/Song.cpp | 74 ++++++++++---------- stepmania/src/SongManager.cpp | 2 +- stepmania/src/song.h | 18 ++--- 14 files changed, 139 insertions(+), 139 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index a549838ccb..b44429b082 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -29,6 +29,7 @@ #include "arch/arch.h" #include "ThemeManager.h" #include "ProfileManager.h" +#include "Foreach.h" /* Amount to increase meter ranges to make them difficult: */ const int COURSE_DIFFICULTY_METER_CHANGE[NUM_COURSE_DIFFICULTIES] = { -2, 0, 2 }; @@ -449,7 +450,7 @@ CString Course::GetAutogenDifficultySuffix( Difficulty diff ) const * play that song, even if we're on difficult and harder notes don't exist. (The * exception is a static song entry with a meter range, but that's not very useful.) */ -bool Course::HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const +bool Course::HasCourseDifficulty( StepsType st, CourseDifficulty cd ) const { /* Check to see if any songs would change if difficult. */ @@ -457,19 +458,19 @@ bool Course::HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const if( cd == COURSE_DIFFICULTY_REGULAR ) return true; - Trail *Regular = GetTrail( nt, COURSE_DIFFICULTY_REGULAR ); - Trail *Other = GetTrail( nt, cd ); + Trail *Regular = GetTrail( st, COURSE_DIFFICULTY_REGULAR ); + Trail *Other = GetTrail( st, cd ); return Regular != Other; } -bool Course::IsPlayableIn( StepsType nt ) const +bool Course::IsPlayableIn( StepsType st ) const { - Trail* pTrail = GetTrail( nt, COURSE_DIFFICULTY_REGULAR ); + Trail* pTrail = GetTrail( st, COURSE_DIFFICULTY_REGULAR ); return !pTrail->m_vEntries.empty(); } -static vector GetFilteredBestSongs( StepsType nt ) +static vector GetFilteredBestSongs( StepsType st ) { const vector &vSongsByMostPlayed = SONGMAN->GetBestSongs(); vector ret; @@ -483,16 +484,16 @@ static vector GetFilteredBestSongs( StepsType nt ) continue; bool FoundMedium = false, FoundHard = false; - for( unsigned j=0; j < pSong->m_apNotes.size(); j++ ) // for each of the Song's Steps + FOREACH( Steps*, pSong->m_apNotes, pSteps ) { - if( pSong->m_apNotes[j]->m_StepsType != nt ) + if( (*pSteps)->m_StepsType != st ) continue; - if( !PREFSMAN->m_bAutogenSteps && pSong->m_apNotes[j]->IsAutogen() ) + if( !PREFSMAN->m_bAutogenSteps && (*pSteps)->IsAutogen() ) continue; - if( pSong->m_apNotes[j]->GetDifficulty() == DIFFICULTY_MEDIUM ) + if( (*pSteps)->GetDifficulty() == DIFFICULTY_MEDIUM ) FoundMedium = true; - else if( pSong->m_apNotes[j]->GetDifficulty() == DIFFICULTY_HARD ) + else if( (*pSteps)->GetDifficulty() == DIFFICULTY_HARD ) FoundHard = true; if( FoundMedium && FoundHard ) @@ -510,12 +511,12 @@ static vector GetFilteredBestSongs( StepsType nt ) /* This is called by many simple functions, like Course::GetTotalSeconds, and may * be called on all songs to sort. It can take time to execute, so we cache the * results. */ -Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const +Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const { // // Look in the Trail cache // - const TrailParams params( nt, cd ); + const TrailParams params( st, cd ); TrailCache::iterator it = m_TrailCache.find( params ); if( it != m_TrailCache.end() ) { @@ -551,7 +552,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const int CurSong = 0; /* Current offset into AllSongsShuffled */ Trail trail; - trail.m_StepsType = nt; + trail.m_StepsType = st; trail.m_CourseDifficulty = cd; for( unsigned i=0; iGetStepsByDifficulty( nt, e.difficulty ); + pNotes = pSong->GetStepsByDifficulty( st, e.difficulty ); else if( e.low_meter != -1 && e.high_meter != -1 ) - pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter ); + pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter ); else - pNotes = pSong->GetStepsByDifficulty( nt, DIFFICULTY_MEDIUM ); + pNotes = pSong->GetStepsByDifficulty( st, DIFFICULTY_MEDIUM ); } break; case COURSE_ENTRY_RANDOM: @@ -607,9 +608,9 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const continue; /* wrong group */ if( e.difficulty == DIFFICULTY_INVALID ) - pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter ); + pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter ); else - pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty ); + pNotes = pSong->GetStepsByDifficulty( st, e.difficulty ); if( pNotes ) // found a match break; // stop searching @@ -625,7 +626,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const if( !bMostPlayedSet ) { bMostPlayedSet = true; - vSongsByMostPlayed = GetFilteredBestSongs( nt ); + vSongsByMostPlayed = GetFilteredBestSongs( st ); } if( e.players_index >= (int)vSongsByMostPlayed.size() ) @@ -644,12 +645,12 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const } if( e.difficulty == DIFFICULTY_INVALID ) - pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter ); + pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter ); else - pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty ); + pNotes = pSong->GetStepsByDifficulty( st, e.difficulty ); if( pNotes == NULL ) - pNotes = pSong->GetClosestNotes( nt, DIFFICULTY_MEDIUM ); + pNotes = pSong->GetClosestNotes( st, DIFFICULTY_MEDIUM ); } break; default: @@ -670,7 +671,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const dc = clamp( dc, DIFFICULTY_BEGINNER, DIFFICULTY_CHALLENGE ); if( dc != original_dc ) { - Steps* pNewNotes = pSong->GetStepsByDifficulty( nt, dc ); + Steps* pNewNotes = pSong->GetStepsByDifficulty( st, dc ); if( pNewNotes ) pNotes = pNewNotes; } @@ -870,11 +871,11 @@ bool Course::IsRanking() const return false; } -float Course::GetMeter( StepsType nt, CourseDifficulty cd ) const +float Course::GetMeter( StepsType st, CourseDifficulty cd ) const { /* If we have a manually-entered meter for this difficulty, use it. */ if( m_iCustomMeter[cd] != -1 ) return (float)m_iCustomMeter[cd]; - return roundf( GetTrail(nt,cd)->GetAverageMeter() ); + return roundf( GetTrail(st,cd)->GetAverageMeter() ); } diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 643677077e..632d83e2e6 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -100,14 +100,14 @@ public: // Dereferences course_entries and returns only the playable Songs and Steps - Trail* GetTrail( StepsType nt, CourseDifficulty cd ) const; - float GetMeter( StepsType nt, CourseDifficulty cd ) const; + Trail* GetTrail( StepsType st, CourseDifficulty cd ) const; + float GetMeter( StepsType st, CourseDifficulty cd ) const; bool HasMods() const; bool AllSongsAreFixed() const; int GetEstimatedNumStages() const { return m_entries.size(); } - bool HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const; - bool IsPlayableIn( StepsType nt ) const; + bool HasCourseDifficulty( StepsType st, CourseDifficulty cd ) const; + bool IsPlayableIn( StepsType st ) const; bool CourseHasBestOrWorst() const; RageColor GetColor() const; bool GetTotalSeconds( StepsType st, float& fSecondsOut ) const; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 6b63c2f3bd..30e6eef12c 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -2360,10 +2360,10 @@ void GameManager::GetStylesForGame( Game game, vector