From f77647b5ad55474d74f11cf10521c6aefdfd4603 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 22 Feb 2007 07:18:05 +0000 Subject: [PATCH] enum name cleanup: DIFFICULTY_* -> Difficulty_* --- stepmania/src/Background.cpp | 2 +- stepmania/src/Course.cpp | 28 +++++++-------- stepmania/src/Course.h | 6 ++-- stepmania/src/CourseEntryDisplay.cpp | 2 +- stepmania/src/CourseLoaderCRS.cpp | 2 +- stepmania/src/CourseUtil.cpp | 4 +-- stepmania/src/Difficulty.cpp | 36 +++++++++---------- stepmania/src/Difficulty.h | 12 +++---- stepmania/src/DifficultyMeter.cpp | 2 +- stepmania/src/EditMenu.cpp | 6 ++-- stepmania/src/GameCommand.cpp | 2 +- stepmania/src/GameState.cpp | 18 +++++----- stepmania/src/LifeMeterBar.cpp | 2 +- stepmania/src/ModeSwitcher.cpp | 48 +++++++++++++------------- stepmania/src/MusicWheel.cpp | 22 ++++++------ stepmania/src/NotesLoaderBMS.cpp | 26 +++++++------- stepmania/src/NotesLoaderKSF.cpp | 8 ++--- stepmania/src/NotesLoaderSM.cpp | 14 ++++---- stepmania/src/NotesWriterDWI.cpp | 12 +++---- stepmania/src/OptionRowHandler.cpp | 14 ++++---- stepmania/src/Player.cpp | 4 +-- stepmania/src/PlayerStageStats.cpp | 4 +-- stepmania/src/ScoreKeeperNormal.cpp | 2 +- stepmania/src/ScreenEdit.cpp | 4 +-- stepmania/src/ScreenEditMenu.cpp | 4 +-- stepmania/src/ScreenGameplay.cpp | 8 ++--- stepmania/src/ScreenNetSelectMusic.cpp | 10 +++--- stepmania/src/Song.cpp | 12 +++---- stepmania/src/SongManager.cpp | 16 ++++----- stepmania/src/SongUtil.cpp | 18 +++++----- stepmania/src/Steps.cpp | 10 +++--- stepmania/src/Steps.h | 4 +-- stepmania/src/StepsUtil.cpp | 10 +++--- stepmania/src/UnlockManager.cpp | 6 ++-- 34 files changed, 189 insertions(+), 189 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 6b3b426406..aa5c6c3dee 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -205,7 +205,7 @@ void BackgroundImpl::Init() bOneOrMoreChars = true; // Disable dancing characters if BH will be showing. if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() && - GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == DIFFICULTY_BEGINNER ) + GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner ) bShowingBeginnerHelper = true; } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 45c6bf7df8..6708f6a58b 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -64,7 +64,7 @@ RString CourseEntry::GetTextDescription() const vsEntryDescription.push_back( songCriteria.m_sGroupName ); if( songCriteria.m_bUseSongGenreAllowedList ) vsEntryDescription.push_back( join(",",songCriteria.m_vsSongGenreAllowedList) ); - if( stepsCriteria.m_difficulty != Difficulty_Invalid && stepsCriteria.m_difficulty != DIFFICULTY_MEDIUM ) + if( stepsCriteria.m_difficulty != Difficulty_Invalid && stepsCriteria.m_difficulty != Difficulty_Medium ) vsEntryDescription.push_back( DifficultyToLocalizedString(stepsCriteria.m_difficulty) ); if( stepsCriteria.m_iLowMeter != -1 ) vsEntryDescription.push_back( ssprintf("Low meter: %d", stepsCriteria.m_iLowMeter) ); @@ -338,16 +338,16 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c if( this->m_bSortByMeter ) { - /* Sort according to DIFFICULTY_MEDIUM, since the order of songs + /* Sort according to Difficulty_Medium, since the order of songs * must not change across difficulties. */ Trail SortTrail; - if( cd == DIFFICULTY_MEDIUM ) + if( cd == Difficulty_Medium ) SortTrail = trail; else { - bool bOK = GetTrailUnsorted( st, DIFFICULTY_MEDIUM, SortTrail ); + bool bOK = GetTrailUnsorted( st, Difficulty_Medium, SortTrail ); - /* If we have any other difficulty, we must have DIFFICULTY_MEDIUM. */ + /* If we have any other difficulty, we must have Difficulty_Medium. */ ASSERT( bOK ); } ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(), @@ -412,8 +412,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) switch( cd ) { - case DIFFICULTY_BEGINNER: - case DIFFICULTY_CHALLENGE: + case Difficulty_Beginner: + case Difficulty_Challenge: return false; } @@ -443,7 +443,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) trail.m_CourseDifficulty = cd; /* Set to true if CourseDifficulty is able to change something. */ - bool bCourseDifficultyIsSignificant = (cd == DIFFICULTY_MEDIUM); + bool bCourseDifficultyIsSignificant = (cd == Difficulty_Medium); vector vpAllPossibleSongs; vector vSongAndSteps; @@ -527,10 +527,10 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) Difficulty dc = resolved.pSteps->GetDifficulty(); int iLowMeter = e->stepsCriteria.m_iLowMeter; int iHighMeter = e->stepsCriteria.m_iHighMeter; - if( cd != DIFFICULTY_MEDIUM && !e->bNoDifficult ) + if( cd != Difficulty_Medium && !e->bNoDifficult ) { - Difficulty new_dc = (Difficulty)(dc + cd - DIFFICULTY_MEDIUM); - new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(DIFFICULTY_EDIT-1) ); + Difficulty new_dc = (Difficulty)(dc + cd - Difficulty_Medium); + new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(Difficulty_Edit-1) ); bool bChangedDifficulty = false; if( new_dc != dc ) @@ -620,7 +620,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) trail.m_iSpecifiedMeter = m_iCustomMeter[cd]; /* If the course difficulty never actually changed anything, then this difficulty - * is equivalent to DIFFICULTY_MEDIUM; it doesn't exist. */ + * is equivalent to Difficulty_Medium; it doesn't exist. */ return bCourseDifficultyIsSignificant; } @@ -761,7 +761,7 @@ bool Course::GetTotalSeconds( StepsType st, float& fSecondsOut ) const if( !AllSongsAreFixed() ) return false; - Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM ); + Trail* pTrail = GetTrail( st, Difficulty_Medium ); fSecondsOut = pTrail->GetLengthSeconds(); return true; @@ -801,7 +801,7 @@ void Course::UpdateCourseStats( StepsType st ) return; } - const Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM ); + const Trail* pTrail = GetTrail( st, Difficulty_Medium ); m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index a1229aea44..50478175a6 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -115,11 +115,11 @@ public: RString GetTranslitFullTitle() const; // Dereferences course_entries and returns only the playable Songs and Steps - Trail* GetTrail( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const; - Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const; + Trail* GetTrail( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; + Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; void GetTrails( vector &AddTo, StepsType st ) const; void GetAllTrails( vector &AddTo ) const; - int GetMeter( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const; + int GetMeter( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; bool HasMods() const; bool AllSongsAreFixed() const; diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index 7885935dbd..e055f8fc60 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -158,7 +158,7 @@ void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex ) Difficulty dc = te->dc; if( dc == Difficulty_Invalid ) - dc = DIFFICULTY_EDIT; + dc = Difficulty_Edit; SetDifficulty( pn, s, dc ); } diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index bdb60e0894..c47a2a5ceb 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -87,7 +87,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou { if( sParams.params.size() == 2 ) { - out.m_iCustomMeter[DIFFICULTY_MEDIUM] = max( atoi(sParams[1]), 0 ); /* compat */ + out.m_iCustomMeter[Difficulty_Medium] = max( atoi(sParams[1]), 0 ); /* compat */ } else if( sParams.params.size() == 3 ) { diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 66a77c223e..103e493c65 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -148,7 +148,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector &vpCours course_sort_val.clear(); for( unsigned i = 0; i < vpCoursesInOut.size(); ++i ) { - int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle()->m_StepsType, DIFFICULTY_MEDIUM ); + int iMeter = vpCoursesInOut[i]->GetMeter( GAMESTATE->GetCurrentStyle()->m_StepsType, Difficulty_Medium ); course_sort_val[vpCoursesInOut[i]] = ssprintf( "%06i", iMeter ); } sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle ); @@ -193,7 +193,7 @@ void CourseUtil::SortByMostRecentlyPlayedForMachine( vector &vpCoursesI void CourseUtil::MakeDefaultEditCourseEntry( CourseEntry& out ) { out.pSong = GAMESTATE->GetDefaultSong(); - out.stepsCriteria.m_difficulty = DIFFICULTY_MEDIUM; + out.stepsCriteria.m_difficulty = Difficulty_Medium; } ////////////////////////////////// diff --git a/stepmania/src/Difficulty.cpp b/stepmania/src/Difficulty.cpp index a5ae426b7f..b12c094cb3 100644 --- a/stepmania/src/Difficulty.cpp +++ b/stepmania/src/Difficulty.cpp @@ -29,24 +29,24 @@ Difficulty StringToDifficulty( const RString& sDC ) { RString s2 = sDC; s2.MakeLower(); - if( s2 == "beginner" ) return DIFFICULTY_BEGINNER; - else if( s2 == "easy" ) return DIFFICULTY_EASY; - else if( s2 == "basic" ) return DIFFICULTY_EASY; - else if( s2 == "light" ) return DIFFICULTY_EASY; - else if( s2 == "medium" ) return DIFFICULTY_MEDIUM; - else if( s2 == "another" ) return DIFFICULTY_MEDIUM; - else if( s2 == "trick" ) return DIFFICULTY_MEDIUM; - else if( s2 == "standard" ) return DIFFICULTY_MEDIUM; - else if( s2 == "difficult") return DIFFICULTY_MEDIUM; - else if( s2 == "hard" ) return DIFFICULTY_HARD; - else if( s2 == "ssr" ) return DIFFICULTY_HARD; - else if( s2 == "maniac" ) return DIFFICULTY_HARD; - else if( s2 == "heavy" ) return DIFFICULTY_HARD; - else if( s2 == "smaniac" ) return DIFFICULTY_CHALLENGE; - else if( s2 == "challenge" )return DIFFICULTY_CHALLENGE; - else if( s2 == "expert" ) return DIFFICULTY_CHALLENGE; - else if( s2 == "oni" ) return DIFFICULTY_CHALLENGE; - else if( s2 == "edit" ) return DIFFICULTY_EDIT; + if( s2 == "beginner" ) return Difficulty_Beginner; + else if( s2 == "easy" ) return Difficulty_Easy; + else if( s2 == "basic" ) return Difficulty_Easy; + else if( s2 == "light" ) return Difficulty_Easy; + else if( s2 == "medium" ) return Difficulty_Medium; + else if( s2 == "another" ) return Difficulty_Medium; + else if( s2 == "trick" ) return Difficulty_Medium; + else if( s2 == "standard" ) return Difficulty_Medium; + else if( s2 == "difficult") return Difficulty_Medium; + else if( s2 == "hard" ) return Difficulty_Hard; + else if( s2 == "ssr" ) return Difficulty_Hard; + else if( s2 == "maniac" ) return Difficulty_Hard; + else if( s2 == "heavy" ) return Difficulty_Hard; + else if( s2 == "smaniac" ) return Difficulty_Challenge; + else if( s2 == "challenge" )return Difficulty_Challenge; + else if( s2 == "expert" ) return Difficulty_Challenge; + else if( s2 == "oni" ) return Difficulty_Challenge; + else if( s2 == "edit" ) return Difficulty_Edit; else return Difficulty_Invalid; } diff --git a/stepmania/src/Difficulty.h b/stepmania/src/Difficulty.h index b46528b96c..f3d42aa1e0 100644 --- a/stepmania/src/Difficulty.h +++ b/stepmania/src/Difficulty.h @@ -8,12 +8,12 @@ // enum Difficulty { - DIFFICULTY_BEGINNER, - DIFFICULTY_EASY, - DIFFICULTY_MEDIUM, - DIFFICULTY_HARD, - DIFFICULTY_CHALLENGE, - DIFFICULTY_EDIT, + Difficulty_Beginner, + Difficulty_Easy, + Difficulty_Medium, + Difficulty_Hard, + Difficulty_Challenge, + Difficulty_Edit, NUM_Difficulty, Difficulty_Invalid }; diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index 08ef0a61e5..5f9a76e669 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -210,7 +210,7 @@ void DifficultyMeter::SetInternal( const SetParams ¶ms ) if( m_bShowEditDescription ) { - if( params.dc == DIFFICULTY_EDIT ) + if( params.dc == Difficulty_Edit ) { m_textEditDescription.SetVisible( true ); m_textEditDescription.SetText( params.sEditDescription ); diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index b6964b7196..08fd3dffbb 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -400,7 +400,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) FOREACH_Difficulty( dc ) { - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { switch( EDIT_MODE.GetValue() ) { @@ -409,7 +409,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) case EditMode_Practice: { vector v; - SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedStepsType(), DIFFICULTY_EDIT ); + SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedStepsType(), Difficulty_Edit ); StepsUtil::SortStepsByDescription( v ); FOREACH_CONST( Steps*, v, p ) m_vpSteps.push_back( StepsAndDifficulty(*p,dc) ); @@ -510,7 +510,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) FOREACH_Difficulty( dc ) { // fill in m_vpSourceSteps - if( dc != DIFFICULTY_EDIT ) + if( dc != Difficulty_Edit ) { Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedSourceStepsType(), dc ); if( pSteps != NULL ) diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 4f2f325ba6..371cb18a9c 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -263,7 +263,7 @@ void GameCommand::LoadOne( const Command& cmd ) RageException::Throw( "Must set Song and Style to set Steps." ); Difficulty dc = StringToDifficulty( sSteps ); - if( dc != DIFFICULTY_EDIT ) + if( dc != Difficulty_Edit ) m_pSteps = SongUtil::GetStepsByDifficulty( pSong, pStyle->m_StepsType, dc ); else m_pSteps = SongUtil::GetStepsByDescription( pSong, pStyle->m_StepsType, sSteps ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 8401fd3b36..b89f853c33 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -237,7 +237,7 @@ void GameState::Reset() FOREACH_PlayerNumber( p ) { m_PreferredDifficulty[p].Set( Difficulty_Invalid ); - m_PreferredCourseDifficulty[p].Set( DIFFICULTY_MEDIUM ); + m_PreferredCourseDifficulty[p].Set( Difficulty_Medium ); } m_SortOrder.Set( SortOrder_Invalid ); m_PreferredSortOrder = GetDefaultSort(); @@ -1052,8 +1052,8 @@ bool GameState::HasEarnedExtraStage() const FOREACH_EnabledPlayer( pn ) { - if( m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_HARD && - m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_CHALLENGE ) + if( m_pCurSteps[pn]->GetDifficulty() != Difficulty_Hard && + m_pCurSteps[pn]->GetDifficulty() != Difficulty_Challenge ) continue; /* not hard enough! */ if( (IsFinalStage() && STATSMAN->m_CurStageStats.m_player[pn].GetGrade() <= GRADE_TIER_FOR_EXTRA_1) || @@ -1269,18 +1269,18 @@ SongOptions::FailType GameState::GetPlayerFailType( const PlayerState *pPlayerSt bool bFirstStage = !IsEventMode() && m_iCurrentStageIndex == 0; /* Easy and beginner are never harder than FAIL_IMMEDIATE_CONTINUE. */ - if( dc <= DIFFICULTY_EASY ) + if( dc <= Difficulty_Easy ) setmax( ft, SongOptions::FAIL_IMMEDIATE_CONTINUE ); - if( dc <= DIFFICULTY_EASY && bFirstStage && PREFSMAN->m_bFailOffForFirstStageEasy ) + if( dc <= Difficulty_Easy && bFirstStage && PREFSMAN->m_bFailOffForFirstStageEasy ) setmax( ft, SongOptions::FAIL_OFF ); /* If beginner's steps were chosen, and this is the first stage, * turn off failure completely. */ - if( dc == DIFFICULTY_BEGINNER && bFirstStage ) + if( dc == Difficulty_Beginner && bFirstStage ) setmax( ft, SongOptions::FAIL_OFF ); - if( dc == DIFFICULTY_BEGINNER && PREFSMAN->m_bFailOffInBeginner ) + if( dc == Difficulty_Beginner && PREFSMAN->m_bFailOffInBeginner ) setmax( ft, SongOptions::FAIL_OFF ); } @@ -1483,7 +1483,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector &asFeatsOu feat.Type = RankingFeat::COURSE; feat.pCourse = pCourse; feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() ); - if( cd != DIFFICULTY_MEDIUM ) + if( cd != Difficulty_Medium ) feat.Feat += " " + CourseDifficultyToLocalizedString(cd); feat.pStringToFill = hs.GetNameMutable(); feat.grade = Grade_NoData; @@ -1700,7 +1700,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir ) } /* The user may be set to prefer a difficulty that isn't always shown; typically, - * DIFFICULTY_EDIT. Return the closest shown difficulty <= m_PreferredDifficulty. */ + * Difficulty_Edit. Return the closest shown difficulty <= m_PreferredDifficulty. */ Difficulty GameState::GetClosestShownDifficulty( PlayerNumber pn ) const { const vector &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index 02d80e82e8..dc93ba7190 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -110,7 +110,7 @@ void LifeMeterBar::Load( const PlayerState *pPlayerState, PlayerStageStats *pPla bool bMercifulBeginnerInEffect = GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR && GAMESTATE->IsPlayerEnabled( pPlayerState ) && - GAMESTATE->m_pCurSteps[pn]->GetDifficulty() == DIFFICULTY_BEGINNER && + GAMESTATE->m_pCurSteps[pn]->GetDifficulty() == Difficulty_Beginner && PREFSMAN->m_bMercifulBeginner; if( bMercifulBeginnerInEffect ) { diff --git a/stepmania/src/ModeSwitcher.cpp b/stepmania/src/ModeSwitcher.cpp index 9bd1fbc00c..2f370284ef 100644 --- a/stepmania/src/ModeSwitcher.cpp +++ b/stepmania/src/ModeSwitcher.cpp @@ -72,8 +72,8 @@ RString ModeSwitcher::GetStyleName() { switch( GAMESTATE->m_PreferredDifficulty[i].Get() ) { - case DIFFICULTY_BEGINNER: sDiff[i] = "Beginner\n"; break; - case DIFFICULTY_EASY: + case Difficulty_Beginner: sDiff[i] = "Beginner\n"; break; + case Difficulty_Easy: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -84,7 +84,7 @@ RString ModeSwitcher::GetStyleName() sDiff[i] = "Light\n"; break; } } - case DIFFICULTY_MEDIUM: + case Difficulty_Medium: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -95,7 +95,7 @@ RString ModeSwitcher::GetStyleName() sDiff[i] = "Standard\n"; break; } } - case DIFFICULTY_HARD: + case Difficulty_Hard: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -106,7 +106,7 @@ RString ModeSwitcher::GetStyleName() sDiff[i] = "Heavy\n"; break; } } - case DIFFICULTY_CHALLENGE: sDiff[i] = "Challenge\n"; break; + case Difficulty_Challenge: sDiff[i] = "Challenge\n"; break; default: sDiff[i] = ""; break; } } @@ -129,14 +129,14 @@ RString ModeSwitcher::GetNextStyleName() { if(GAMESTATE->IsPlayerEnabled(i)) { - if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_CHALLENGE) + if(GAMESTATE->m_PreferredDifficulty[i] != Difficulty_Challenge) { sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName; sStyleName[i].MakeUpper(); switch(GAMESTATE->m_PreferredDifficulty[i]) { - case DIFFICULTY_BEGINNER: + case Difficulty_Beginner: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -147,7 +147,7 @@ RString ModeSwitcher::GetNextStyleName() sDiff[i] = "Light\n"; break; } } - case DIFFICULTY_EASY: + case Difficulty_Easy: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -158,7 +158,7 @@ RString ModeSwitcher::GetNextStyleName() sDiff[i] = "Standard\n"; break; } } - case DIFFICULTY_MEDIUM: + case Difficulty_Medium: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -169,8 +169,8 @@ RString ModeSwitcher::GetNextStyleName() sDiff[i] = "Heavy\n"; break; } } - case DIFFICULTY_HARD: sDiff[i] = "Challenge\n"; break; - case DIFFICULTY_CHALLENGE: sDiff[i] = "Beginner\n"; break; + case Difficulty_Hard: sDiff[i] = "Challenge\n"; break; + case Difficulty_Challenge: sDiff[i] = "Beginner\n"; break; default: sDiff[i] = ""; break; } } @@ -202,14 +202,14 @@ RString ModeSwitcher::GetPrevStyleName() { if(GAMESTATE->IsPlayerEnabled(i)) { - if(GAMESTATE->m_PreferredDifficulty[i] != DIFFICULTY_BEGINNER) + if(GAMESTATE->m_PreferredDifficulty[i] != Difficulty_Beginner) { sStyleName[i] = GAMESTATE->GetCurrentStyle()->m_szName; sStyleName[i].MakeUpper(); switch(GAMESTATE->m_PreferredDifficulty[i]) { - case DIFFICULTY_CHALLENGE: + case Difficulty_Challenge: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -220,8 +220,8 @@ RString ModeSwitcher::GetPrevStyleName() sDiff[i] = "Heavy\n"; break; } } - case DIFFICULTY_EASY: sDiff[i] = "Beginner\n"; break; - case DIFFICULTY_MEDIUM: + case Difficulty_Easy: sDiff[i] = "Beginner\n"; break; + case Difficulty_Medium: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -232,7 +232,7 @@ RString ModeSwitcher::GetPrevStyleName() sDiff[i] = "Light\n"; break; } } - case DIFFICULTY_HARD: + case Difficulty_Hard: { if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) { @@ -243,7 +243,7 @@ RString ModeSwitcher::GetPrevStyleName() sDiff[i] = "Standard\n"; break; } } - case DIFFICULTY_BEGINNER: sDiff[i] = "Challenge\n"; break; + case Difficulty_Beginner: sDiff[i] = "Challenge\n"; break; default: sDiff[i] = ""; break; } } @@ -272,14 +272,14 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir) { if(GAMESTATE->IsPlayerEnabled(pn)) { - if(GAMESTATE->m_PreferredDifficulty[pn] != DIFFICULTY_CHALLENGE) + if(GAMESTATE->m_PreferredDifficulty[pn] != Difficulty_Challenge) { switch(GAMESTATE->m_PreferredDifficulty[pn]) { - case DIFFICULTY_BEGINNER: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_EASY ); break; - case DIFFICULTY_EASY: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_MEDIUM ); break; - case DIFFICULTY_MEDIUM: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_HARD ); break; - case DIFFICULTY_HARD: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_CHALLENGE ); break; + case Difficulty_Beginner: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Easy ); break; + case Difficulty_Easy: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Medium ); break; + case Difficulty_Medium: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Hard ); break; + case Difficulty_Hard: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Challenge ); break; } m_Stylename.SetText(GetStyleName()); m_Nextmode.SetText(GetNextStyleName()); @@ -289,9 +289,9 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir) else { if(GAMESTATE->IsPlayerEnabled(PLAYER_1)) - GAMESTATE->m_PreferredDifficulty[PLAYER_1].Set( DIFFICULTY_CHALLENGE ); + GAMESTATE->m_PreferredDifficulty[PLAYER_1].Set( Difficulty_Challenge ); if(GAMESTATE->IsPlayerEnabled(PLAYER_2)) - GAMESTATE->m_PreferredDifficulty[PLAYER_2].Set( DIFFICULTY_CHALLENGE ); + GAMESTATE->m_PreferredDifficulty[PLAYER_2].Set( Difficulty_Challenge ); } } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index a53f158452..54c552d5a1 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -433,7 +433,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDat // obey order specified by the preferred sort list break; case SORT_ROULETTE: - SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY ); + SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Easy ); if( (bool)PREFSMAN->m_bPreferredSortUsesGroups ) stable_sort( arraySongs.begin(), arraySongs.end(), SongUtil::CompareSongPointersByGroup ); bUseSections = false; @@ -463,16 +463,16 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelItemDat SongUtil::SortSongPointerArrayByGenre( arraySongs ); break; case SORT_EASY_METER: - SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY ); + SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Easy ); break; case SORT_MEDIUM_METER: - SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_MEDIUM ); + SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Medium ); break; case SORT_HARD_METER: - SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_HARD ); + SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Hard ); break; case SORT_CHALLENGE_METER: - SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_CHALLENGE ); + SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Challenge ); break; default: ASSERT(0); // unhandled SortOrder @@ -737,10 +737,10 @@ void MusicWheel::UpdateSwitch() Difficulty dc = Difficulty_Invalid; switch( GAMESTATE->m_SortOrder ) { - case SORT_EASY_METER: dc = DIFFICULTY_EASY; break; - case SORT_MEDIUM_METER: dc = DIFFICULTY_MEDIUM; break; - case SORT_HARD_METER: dc = DIFFICULTY_HARD; break; - case SORT_CHALLENGE_METER: dc = DIFFICULTY_CHALLENGE; break; + case SORT_EASY_METER: dc = Difficulty_Easy; break; + case SORT_MEDIUM_METER: dc = Difficulty_Medium; break; + case SORT_HARD_METER: dc = Difficulty_Hard; break; + case SORT_CHALLENGE_METER: dc = Difficulty_Challenge; break; } if( dc != Difficulty_Invalid ) { @@ -1049,10 +1049,10 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() continue; // skip // TRICKY: Don't require that edits be present if perferred - // difficulty is DIFFICULTY_EDIT. Otherwise, players could use this + // difficulty is Difficulty_Edit. Otherwise, players could use this // to set up a 100% chance of getting a particular locked song by // having a single edit for a locked song. - if( GAMESTATE->m_PreferredDifficulty[p] == DIFFICULTY_EDIT ) + if( GAMESTATE->m_PreferredDifficulty[p] == Difficulty_Edit ) continue; // skip vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] ); diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index e7ce542d7f..c4cee496fb 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -274,16 +274,16 @@ static void SearchForDifficulty( RString sTag, Steps *pOut ) /* Only match "Light" in parentheses. */ if( sTag.find( "(light" ) != sTag.npos ) { - pOut->SetDifficulty( DIFFICULTY_EASY ); + pOut->SetDifficulty( Difficulty_Easy ); } else if( sTag.find( "another" ) != sTag.npos ) { - pOut->SetDifficulty( DIFFICULTY_HARD ); + pOut->SetDifficulty( Difficulty_Hard ); } else if( sTag.find( "(solo)" ) != sTag.npos ) { pOut->SetDescription( "Solo" ); - pOut->SetDifficulty( DIFFICULTY_EDIT ); + pOut->SetDifficulty( Difficulty_Edit ); } LOG->Trace( "Tag \"%s\" is %s", sTag.c_str(), DifficultyToString(pOut->GetDifficulty()).c_str() ); @@ -934,7 +934,7 @@ static void SlideDuplicateDifficulties( Song &p ) { FOREACH_Difficulty( dc ) { - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) continue; vector vSteps; @@ -945,7 +945,7 @@ static void SlideDuplicateDifficulties( Song &p ) { Steps* pSteps = vSteps[k]; - Difficulty dc2 = min( (Difficulty)(dc+1), DIFFICULTY_CHALLENGE ); + Difficulty dc2 = min( (Difficulty)(dc+1), Difficulty_Challenge ); pSteps->SetDifficulty( dc2 ); } } @@ -999,7 +999,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) for( unsigned i=0; iSetDifficulty( DIFFICULTY_MEDIUM ); + pSteps->SetDifficulty( Difficulty_Medium ); RString sTag; if( GetTagFromMap( aBMSData[i], "#title", sTag ) && sTag.size() != commonSubstring.size() ) { @@ -1017,20 +1017,20 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) if( lPos > 2 && sTag.substr(lPos-2,4) == "solo" ) { // (solo) -- an edit, apparently (Thanks Glenn!) - pSteps->SetDifficulty( DIFFICULTY_EDIT ); + pSteps->SetDifficulty( Difficulty_Edit ); } else { // Any of [L7] [L14] (LIGHT7) (LIGHT14) (LIGHT) [L] ... you get the idea. - pSteps->SetDifficulty( DIFFICULTY_EASY ); + pSteps->SetDifficulty( Difficulty_Easy ); } } // [A] (A) [ANOTHER] (ANOTHER) (ANOTHER7) Another (DP ANOTHER) (Another) -ANOTHER- [A7] [A14] etc etc etc else if( sTag.find('a') != sTag.npos ) - pSteps->SetDifficulty( DIFFICULTY_HARD ); + pSteps->SetDifficulty( Difficulty_Hard ); // XXX: Can also match (double), but should match [B] or [B7] else if( sTag.find('b') != sTag.npos ) - pSteps->SetDifficulty( DIFFICULTY_BEGINNER ); + pSteps->SetDifficulty( Difficulty_Beginner ); // Other tags I've seen here include (5KEYS) (10KEYS) (7keys) (14keys) (dp) [MIX] [14] (14 Keys Mix) // XXX: I'm sure [MIX] means something... anyone know? } @@ -1046,7 +1046,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) { // XXX: Is this really effective if Common Substring parsing failed? Steps *pSteps = apSteps[i]; - pSteps->SetDifficulty( DIFFICULTY_MEDIUM ); + pSteps->SetDifficulty( Difficulty_Medium ); RString sTag; if( GetTagFromMap( aBMSData[i], "#title", sTag ) ) SearchForDifficulty( sTag, pSteps ); @@ -1055,12 +1055,12 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out ) } } - /* Prefer to read global tags from a DIFFICULTY_MEDIUM file. These tend to + /* Prefer to read global tags from a Difficulty_Medium file. These tend to * have the least cruft in the #TITLE tag, so it's more likely to get a clean * title. */ int iMainDataIndex = 0; for( unsigned i=1; iGetDifficulty() == DIFFICULTY_MEDIUM ) + if( apSteps[i]->GetDifficulty() == Difficulty_Medium ) iMainDataIndex = i; MeasureToTimeSig_t sigAdjustments; diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 84c54e2b11..bf8816db69 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -116,23 +116,23 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, if( sFName.find("crazy") != string::npos || sFName.find("nightmare") != string::npos || sFName.find("crazydouble") != string::npos ) { - out.SetDifficulty( DIFFICULTY_HARD ); + out.SetDifficulty( Difficulty_Hard ); if( !out.GetMeter() ) out.SetMeter( 14 ); // Set the meters to the Pump scale, not DDR. } else if( sFName.find("hard") != string::npos || sFName.find("freestyle") != string::npos || sFName.find("double") != string::npos ) { - out.SetDifficulty( DIFFICULTY_MEDIUM ); + out.SetDifficulty( Difficulty_Medium ); if( !out.GetMeter() ) out.SetMeter( 8 ); } else if( sFName.find("easy") != string::npos || sFName.find("normal") != string::npos ) { - out.SetDifficulty( DIFFICULTY_EASY ); + out.SetDifficulty( Difficulty_Easy ); if( !out.GetMeter() ) out.SetMeter( 4 ); } else { - out.SetDifficulty( DIFFICULTY_MEDIUM ); + out.SetDifficulty( Difficulty_Medium ); if( !out.GetMeter() ) out.SetMeter( 8 ); } diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 8d932bf446..44d5858f02 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -36,14 +36,14 @@ static void LoadFromSMTokens( out.SetDescription( sDescription ); out.SetDifficulty( StringToDifficulty(sDifficulty) ); - // HACK: We used to store SMANIAC as DIFFICULTY_HARD with special description. - // Now, it has its own DIFFICULTY_CHALLENGE + // HACK: We used to store SMANIAC as Difficulty_Hard with special description. + // Now, it has its own Difficulty_Challenge if( sDescription.CompareNoCase("smaniac") == 0 ) - out.SetDifficulty( DIFFICULTY_CHALLENGE ); - // HACK: We used to store CHALLENGE as DIFFICULTY_HARD with special description. - // Now, it has its own DIFFICULTY_CHALLENGE + out.SetDifficulty( Difficulty_Challenge ); + // HACK: We used to store CHALLENGE as Difficulty_Hard with special description. + // Now, it has its own Difficulty_Challenge if( sDescription.CompareNoCase("challenge") == 0 ) - out.SetDifficulty( DIFFICULTY_CHALLENGE ); + out.SetDifficulty( Difficulty_Challenge ); out.SetMeter( atoi(sMeter) ); vector saValues; @@ -540,7 +540,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath *pNewNotes); pNewNotes->SetLoadedFromProfile( slot ); - pNewNotes->SetDifficulty( DIFFICULTY_EDIT ); + pNewNotes->SetDifficulty( Difficulty_Edit ); pNewNotes->SetFilename( sEditFilePath ); if( pSong->IsEditAlreadyLoaded(pNewNotes) ) diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index 1b8df6d76e..94b6b48b54 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -315,7 +315,7 @@ static void WriteDWINotesField( RageFile &f, const Steps &out, int start ) static bool WriteDWINotesTag( RageFile &f, const Steps &out ) { - if( out.GetDifficulty() == DIFFICULTY_EDIT ) + if( out.GetDifficulty() == Difficulty_Edit ) return false; // not supported by DWI /* Flush dir cache when writing steps, so the old size isn't cached. */ @@ -334,11 +334,11 @@ static bool WriteDWINotesTag( RageFile &f, const Steps &out ) switch( out.GetDifficulty() ) { - case DIFFICULTY_BEGINNER: f.Write( "BEGINNER:" ); break; - case DIFFICULTY_EASY: f.Write( "BASIC:" ); break; - case DIFFICULTY_MEDIUM: f.Write( "ANOTHER:" ); break; - case DIFFICULTY_HARD: f.Write( "MANIAC:" ); break; - case DIFFICULTY_CHALLENGE: f.Write( "SMANIAC:" ); break; + case Difficulty_Beginner: f.Write( "BEGINNER:" ); break; + case Difficulty_Easy: f.Write( "BASIC:" ); break; + case Difficulty_Medium: f.Write( "ANOTHER:" ); break; + case Difficulty_Hard: f.Write( "MANIAC:" ); break; + case Difficulty_Challenge: f.Write( "SMANIAC:" ); break; default: ASSERT(0); return false; } diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 294e3ad37b..ed1611175e 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -397,7 +397,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList Steps* pSteps = vpSteps[i]; RString s; - if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) + if( pSteps->GetDifficulty() == Difficulty_Edit ) s = pSteps->GetDescription(); else s = DifficultyToLocalizedString( pSteps->GetDifficulty() ); @@ -482,19 +482,19 @@ public: { FOREACH_Difficulty( dc ) { - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) continue; m_vDifficulties.push_back( dc ); Steps* pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, *m_pst, dc ); m_vSteps.push_back( pSteps ); } - SongUtil::GetSteps( GAMESTATE->m_pCurSong, m_vSteps, *m_pst, DIFFICULTY_EDIT ); - m_vDifficulties.resize( m_vSteps.size(), DIFFICULTY_EDIT ); + SongUtil::GetSteps( GAMESTATE->m_pCurSong, m_vSteps, *m_pst, Difficulty_Edit ); + m_vDifficulties.resize( m_vSteps.size(), Difficulty_Edit ); if( sParam == "EditSteps" ) { m_vSteps.push_back( NULL ); - m_vDifficulties.push_back( DIFFICULTY_EDIT ); + m_vDifficulties.push_back( Difficulty_Edit ); } for( unsigned i=0; iGetDescription(); @@ -519,7 +519,7 @@ public: } else { - m_vDifficulties.push_back( DIFFICULTY_EDIT ); + m_vDifficulties.push_back( Difficulty_Edit ); m_vSteps.push_back( NULL ); m_Def.m_vsChoices.push_back( "none" ); } diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index b081c09d9c..3d7f9d4ce1 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -2494,7 +2494,7 @@ bool Player::IsPlayingBeginner() const if( m_pPlayerStageStats != NULL && !m_pPlayerStageStats->m_vpPossibleSteps.empty() ) { Steps *pSteps = m_pPlayerStageStats->m_vpPossibleSteps[0]; - return pSteps->GetDifficulty() == DIFFICULTY_BEGINNER; + return pSteps->GetDifficulty() == Difficulty_Beginner; } if( m_pPlayerState == NULL ) @@ -2503,7 +2503,7 @@ bool Player::IsPlayingBeginner() const if( m_pPlayerState->m_PlayerNumber == PLAYER_INVALID ) return false; Steps *pSteps = GAMESTATE->m_pCurSteps[ m_pPlayerState->m_PlayerNumber ]; - return pSteps && pSteps->GetDifficulty() == DIFFICULTY_BEGINNER; + return pSteps && pSteps->GetDifficulty() == Difficulty_Beginner; } void Player::SetJudgment( TapNoteScore tns, bool bEarly ) diff --git a/stepmania/src/PlayerStageStats.cpp b/stepmania/src/PlayerStageStats.cpp index 40929dd92b..4d663f64c8 100644 --- a/stepmania/src/PlayerStageStats.cpp +++ b/stepmania/src/PlayerStageStats.cpp @@ -158,7 +158,7 @@ Grade PlayerStageStats::GetGrade() const bool bIsBeginner = false; if( m_vpPlayedSteps.size() && !GAMESTATE->IsCourseMode() ) - bIsBeginner = m_vpPlayedSteps[0]->GetDifficulty() == DIFFICULTY_BEGINNER; + bIsBeginner = m_vpPlayedSteps[0]->GetDifficulty() == Difficulty_Beginner; FOREACH_TapNoteScore( tns ) { @@ -186,7 +186,7 @@ Grade PlayerStageStats::GetGrade() const PREFSMAN->m_bMercifulBeginner; FOREACH_CONST( Steps*, m_vpPlayedSteps, s ) { - if( (*s)->GetDifficulty() != DIFFICULTY_BEGINNER ) + if( (*s)->GetDifficulty() != Difficulty_Beginner ) bMerciful = false; } diff --git a/stepmania/src/ScoreKeeperNormal.cpp b/stepmania/src/ScoreKeeperNormal.cpp index ab3a472532..cc04909d4d 100644 --- a/stepmania/src/ScoreKeeperNormal.cpp +++ b/stepmania/src/ScoreKeeperNormal.cpp @@ -229,7 +229,7 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps, /* MercifulBeginner shouldn't clamp weights in course mode, even if a beginner song * is in a course, since that makes PlayerStageStats::GetGrade hard. */ - m_bIsBeginner = pSteps->GetDifficulty() == DIFFICULTY_BEGINNER && !GAMESTATE->IsCourseMode(); + m_bIsBeginner = pSteps->GetDifficulty() == Difficulty_Beginner && !GAMESTATE->IsCourseMode(); ASSERT( m_iPointBonus >= 0 ); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 945ff88e41..5b76edf8c1 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -2634,7 +2634,7 @@ static void ChangeDescription( const RString &sNew ) Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; /* Don't erase edit descriptions. */ - if( sNew.empty() && pSteps->GetDifficulty() == DIFFICULTY_EDIT ) + if( sNew.empty() && pSteps->GetDifficulty() == Difficulty_Edit ) return; pSteps->SetDescription(sNew); @@ -3248,7 +3248,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v SM_None, ENTER_NEW_DESCRIPTION, m_pSteps->GetDescription(), - (dc == DIFFICULTY_EDIT) ? MAX_EDIT_STEPS_DESCRIPTION_LENGTH : 255, + (dc == Difficulty_Edit) ? MAX_EDIT_STEPS_DESCRIPTION_LENGTH : 255, SongUtil::ValidateCurrentStepsDescription, ChangeDescription, NULL diff --git a/stepmania/src/ScreenEditMenu.cpp b/stepmania/src/ScreenEditMenu.cpp index a86e56d8a0..bd4111dae2 100644 --- a/stepmania/src/ScreenEditMenu.cpp +++ b/stepmania/src/ScreenEditMenu.cpp @@ -136,7 +136,7 @@ void ScreenEditMenu::MenuRight( const InputEventPlus &input ) static RString GetCopyDescription( const Steps *pSourceSteps ) { RString s; - if( pSourceSteps->GetDifficulty() == DIFFICULTY_EDIT ) + if( pSourceSteps->GetDifficulty() == Difficulty_Edit ) s = pSourceSteps->GetDescription(); else s = DifficultyToLocalizedString( pSourceSteps->GetDifficulty() ); @@ -302,7 +302,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus &input ) { // Prepare prepare for ScreenEdit ASSERT( pSteps ); - bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == DIFFICULTY_EDIT); + bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == Difficulty_Edit); if( bPromptToNameSteps ) { ScreenTextEntry::TextEntry( diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 54b3f77bcd..a668cafb2a 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -376,7 +376,7 @@ void ScreenGameplay::Init() return; // ScreenDemonstration will move us to the next screen. We just need to survive for one update without crashing. /* Save settings to the profile now. Don't do this on extra stages, since the - * user doesn't have full control; saving would force profiles to DIFFICULTY_HARD + * user doesn't have full control; saving would force profiles to Difficulty_Hard * and save over their default modifiers every time someone got an extra stage. * Do this before course modifiers are set up. */ if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) @@ -1170,7 +1170,7 @@ void ScreenGameplay::LoadNextSong() FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) { Steps *pSteps = GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ]; - if( pSteps->GetDifficulty() == DIFFICULTY_BEGINNER ) + if( pSteps->GetDifficulty() == Difficulty_Beginner ) m_BeginnerHelper.AddPlayer( pi->GetStepsAndTrailIndex(), pi->m_pPlayer->GetNoteData() ); } } @@ -1262,7 +1262,7 @@ void ScreenGameplay::LoadLights() m_CabinetLightsNoteData.Init(); ASSERT( GAMESTATE->m_pCurSong ); - const Steps *pSteps = SongUtil::GetClosestNotes( GAMESTATE->m_pCurSong, STEPS_TYPE_LIGHTS_CABINET, DIFFICULTY_MEDIUM ); + const Steps *pSteps = SongUtil::GetClosestNotes( GAMESTATE->m_pCurSong, STEPS_TYPE_LIGHTS_CABINET, Difficulty_Medium ); if( pSteps != NULL ) { pSteps->GetNoteData( m_CabinetLightsNoteData ); @@ -1951,7 +1951,7 @@ void ScreenGameplay::SendCrossedMessages() PlayerNumber pn = PLAYER_INVALID; FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) { - if( GAMESTATE->m_pCurSteps[ pi->m_pn ]->GetDifficulty() == DIFFICULTY_BEGINNER ) + if( GAMESTATE->m_pCurSteps[ pi->m_pn ]->GetDifficulty() == Difficulty_Beginner ) { pn = pi->m_pn; break; diff --git a/stepmania/src/ScreenNetSelectMusic.cpp b/stepmania/src/ScreenNetSelectMusic.cpp index c031c9fc23..15d8b60a3d 100644 --- a/stepmania/src/ScreenNetSelectMusic.cpp +++ b/stepmania/src/ScreenNetSelectMusic.cpp @@ -490,11 +490,11 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn ) { if ( GAMESTATE->m_pCurSong == NULL ) { - m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, DIFFICULTY_BEGINNER ); + m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, Difficulty_Beginner ); m_DifficultyIcon[pn].SetFromSteps( pn, NULL ); //It will blank it out return; } - if ( m_DC[pn] < DIFFICULTY_EDIT && m_DC[pn] >= DIFFICULTY_BEGINNER ) + if ( m_DC[pn] < Difficulty_Edit && m_DC[pn] >= Difficulty_Beginner ) { m_DifficultyIcon[pn].SetPlayer( pn ); m_DifficultyIcon[pn].SetFromDifficulty( m_DC[pn] ); @@ -507,10 +507,10 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn ) Steps * pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, st, m_DC[pn] ); GAMESTATE->m_pCurSteps[pn].Set( pSteps ); - if ( ( m_DC[pn] < NUM_Difficulty ) && ( m_DC[pn] >= DIFFICULTY_BEGINNER ) ) + if ( ( m_DC[pn] < NUM_Difficulty ) && ( m_DC[pn] >= Difficulty_Beginner ) ) m_DifficultyMeters[pn].SetFromSteps( pSteps ); else - m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, DIFFICULTY_BEGINNER ); + m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, Difficulty_Beginner ); } void ScreenNetSelectMusic::MusicChanged() @@ -535,7 +535,7 @@ void ScreenNetSelectMusic::MusicChanged() else { int i; - Difficulty Target = DIFFICULTY_EASY; + Difficulty Target = Difficulty_Easy; bool dcs[NUM_Difficulty]; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index df8d5e9eff..5e9f1ddee0 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -979,11 +979,11 @@ bool Song::IsEasy( StepsType st ) const /* The easy marker indicates which songs a beginner, having selected "beginner", * can play and actually get a very easy song: if there are actual beginner * steps, or if the light steps are 1- or 2-foot. */ - const Steps* pBeginnerNotes = SongUtil::GetStepsByDifficulty( this, st, DIFFICULTY_BEGINNER ); + const Steps* pBeginnerNotes = SongUtil::GetStepsByDifficulty( this, st, Difficulty_Beginner ); if( pBeginnerNotes ) return true; - const Steps* pEasyNotes = SongUtil::GetStepsByDifficulty( this, st, DIFFICULTY_EASY ); + const Steps* pEasyNotes = SongUtil::GetStepsByDifficulty( this, st, Difficulty_Easy ); if( pEasyNotes && pEasyNotes->GetMeter() == 1 ) return true; @@ -997,7 +997,7 @@ bool Song::IsTutorial() const { if( (*s)->m_StepsType == STEPS_TYPE_LIGHTS_CABINET ) continue; // ignore - if( (*s)->GetDifficulty() != DIFFICULTY_BEGINNER ) + if( (*s)->GetDifficulty() != Difficulty_Beginner ) return false; } @@ -1010,7 +1010,7 @@ bool Song::HasEdits( StepsType st ) const { Steps* pSteps = m_vpSteps[i]; if( pSteps->m_StepsType == st && - pSteps->GetDifficulty() == DIFFICULTY_EDIT ) + pSteps->GetDifficulty() == Difficulty_Edit ) { return true; } @@ -1273,12 +1273,12 @@ int Song::GetNumStepsLoadedFromProfile( ProfileSlot slot ) const bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const { - ASSERT( pSteps->GetDifficulty() == DIFFICULTY_EDIT ); + ASSERT( pSteps->GetDifficulty() == Difficulty_Edit ); for( unsigned i=0; iGetDifficulty() == DIFFICULTY_EDIT && + if( pOther->GetDifficulty() == Difficulty_Edit && pOther->m_StepsType == pSteps->m_StepsType && pOther->GetHash() == pSteps->GetHash() ) { diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index bab3a2df97..650fc1fe23 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -428,8 +428,8 @@ RageColor SongManager::GetSongColor( const Song* pSong ) const Steps* pSteps = vpSteps[i]; switch( pSteps->GetDifficulty() ) { - case DIFFICULTY_CHALLENGE: - case DIFFICULTY_EDIT: + case Difficulty_Challenge: + case Difficulty_Edit: continue; } @@ -735,11 +735,11 @@ void SongManager::InitAutogenCourses() // Generate random courses from each group. pCourse = new Course; - CourseUtil::AutogenEndlessFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse ); + CourseUtil::AutogenEndlessFromGroup( sGroupName, Difficulty_Medium, *pCourse ); m_pCourses.push_back( pCourse ); pCourse = new Course; - CourseUtil::AutogenNonstopFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse ); + CourseUtil::AutogenNonstopFromGroup( sGroupName, Difficulty_Medium, *pCourse ); m_pCourses.push_back( pCourse ); } @@ -747,7 +747,7 @@ void SongManager::InitAutogenCourses() // Generate "All Songs" endless course. pCourse = new Course; - CourseUtil::AutogenEndlessFromGroup( "", DIFFICULTY_MEDIUM, *pCourse ); + CourseUtil::AutogenEndlessFromGroup( "", Difficulty_Medium, *pCourse ); m_pCourses.push_back( pCourse ); /* Generate Oni courses from artists. Only create courses if we have at least @@ -782,7 +782,7 @@ void SongManager::InitAutogenCourses() sCurArtist.CompareNoCase("Unknown artist") ) { pCourse = new Course; - CourseUtil::AutogenOniFromArtist( sCurArtist, sCurArtistTranslit, aSongs, DIFFICULTY_HARD, *pCourse ); + CourseUtil::AutogenOniFromArtist( sCurArtist, sCurArtistTranslit, aSongs, Difficulty_Hard, *pCourse ); m_pCourses.push_back( pCourse ); } @@ -1030,8 +1030,8 @@ bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredG bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2) { /* Equate CHALLENGE to HARD. */ - Difficulty d1 = min(n1->GetDifficulty(), DIFFICULTY_HARD); - Difficulty d2 = min(n2->GetDifficulty(), DIFFICULTY_HARD); + Difficulty d1 = min(n1->GetDifficulty(), Difficulty_Hard); + Difficulty d2 = min(n2->GetDifficulty(), Difficulty_Hard); if(d1 < d2) return true; if(d1 > d2) return false; diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index 7022d374ee..92a63ff614 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -205,7 +205,7 @@ Steps* SongUtil::GetClosestNotes( const Song *pSong, StepsType st, Difficulty dc { Steps* pSteps = vpSteps[i]; - if( pSteps->GetDifficulty() == DIFFICULTY_EDIT && dc != DIFFICULTY_EDIT ) + if( pSteps->GetDifficulty() == Difficulty_Edit && dc != Difficulty_Edit ) continue; if( bIgnoreLocked && UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) continue; @@ -230,7 +230,7 @@ void SongUtil::AdjustDuplicateSteps( Song *pSong ) { FOREACH_Difficulty( dc ) { - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) continue; vector vSteps; @@ -245,7 +245,7 @@ void SongUtil::AdjustDuplicateSteps( Song *pSong ) CHECKPOINT; for( unsigned k=1; kSetDifficulty( DIFFICULTY_EDIT ); + vSteps[k]->SetDifficulty( Difficulty_Edit ); if( vSteps[k]->GetDescription() == "" ) { /* "Hard Edit" */ @@ -576,28 +576,28 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so } case SORT_EASY_METER: { - Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_EASY); + Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,Difficulty_Easy); if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) return ssprintf("%02d", pSteps->GetMeter() ); return SORT_NOT_AVAILABLE.GetValue(); } case SORT_MEDIUM_METER: { - Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_MEDIUM); + Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,Difficulty_Medium); if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) return ssprintf("%02d", pSteps->GetMeter() ); return SORT_NOT_AVAILABLE.GetValue(); } case SORT_HARD_METER: { - Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_HARD); + Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,Difficulty_Hard); if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) return ssprintf("%02d", pSteps->GetMeter() ); return SORT_NOT_AVAILABLE.GetValue(); } case SORT_CHALLENGE_METER: { - Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,DIFFICULTY_CHALLENGE); + Steps* pSteps = GetStepsByDifficulty(pSong, GAMESTATE->GetCurrentStyle()->m_StepsType,Difficulty_Challenge); if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) return ssprintf("%02d", pSteps->GetMeter() ); return SORT_NOT_AVAILABLE.GetValue(); @@ -685,7 +685,7 @@ bool SongUtil::IsEditDescriptionUnique( const Song* pSong, StepsType st, const R { Steps *pSteps = *s; - if( pSteps->GetDifficulty() != DIFFICULTY_EDIT ) + if( pSteps->GetDifficulty() != Difficulty_Edit ) continue; if( pSteps->m_StepsType != st ) continue; @@ -744,7 +744,7 @@ bool SongUtil::ValidateCurrentEditStepsDescription( const RString &sAnswer, RStr // Steps name must be unique for this song. vector v; - GetSteps( pSong, v, StepsType_Invalid, DIFFICULTY_EDIT ); + GetSteps( pSong, v, StepsType_Invalid, Difficulty_Edit ); FOREACH_CONST( Steps*, v, s ) { if( pSteps == *s ) diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 9fbcfeb082..200d0d8565 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -153,10 +153,10 @@ void Steps::TidyUpData() if( GetDifficulty() == Difficulty_Invalid ) { - if( GetMeter() == 1 ) SetDifficulty( DIFFICULTY_BEGINNER ); - else if( GetMeter() <= 3 ) SetDifficulty( DIFFICULTY_EASY ); - else if( GetMeter() <= 6 ) SetDifficulty( DIFFICULTY_MEDIUM ); - else SetDifficulty( DIFFICULTY_HARD ); + if( GetMeter() == 1 ) SetDifficulty( Difficulty_Beginner ); + else if( GetMeter() <= 3 ) SetDifficulty( Difficulty_Easy ); + else if( GetMeter() <= 6 ) SetDifficulty( Difficulty_Medium ); + else SetDifficulty( Difficulty_Hard ); } if( GetMeter() < 1) // meter is invalid @@ -359,7 +359,7 @@ void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription ) DeAutogen(); m_Difficulty = dc; m_sDescription = sDescription; - if( GetDifficulty() == DIFFICULTY_EDIT ) + if( GetDifficulty() == Difficulty_Edit ) MakeValidEditDescription( m_sDescription ); } diff --git a/stepmania/src/Steps.h b/stepmania/src/Steps.h index 14456460f8..641ca3a657 100644 --- a/stepmania/src/Steps.h +++ b/stepmania/src/Steps.h @@ -31,7 +31,7 @@ public: bool IsAutogen() const { return parent != NULL; } // Was created by autogen? // Use a special value of difficulty - bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; } + bool IsAnEdit() const { return m_Difficulty == Difficulty_Edit; } bool IsAPlayerEdit() const { return IsAnEdit() && GetLoadedFromProfileSlot() < ProfileSlot_Machine; } bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_Invalid; } ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } @@ -87,7 +87,7 @@ private: ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if wasn't loaded from a profile /* These values are pulled from the autogen source first, if there is one. */ - mutable unsigned m_iHash; // only used if m_Difficulty == DIFFICULTY_EDIT + mutable unsigned m_iHash; // only used if m_Difficulty == Difficulty_Edit RString m_sDescription; // Step author, edit name, or something meaningful Difficulty m_Difficulty; // difficulty classification int m_iMeter; // difficulty rating from MIN_METER to MAX_METER diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index 07bfc4d0a7..9e8a4c8968 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -199,7 +199,7 @@ void StepsID::FromSteps( const Steps *p ) { st = p->m_StepsType; dc = p->GetDifficulty(); - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { sDescription = p->GetDescription(); uHash = p->GetHash(); @@ -240,7 +240,7 @@ Steps *StepsID::ToSteps( const Song *p, bool bAllowNull, bool bUseCache ) const } Steps *ret = NULL; - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { ret = SongUtil::GetOneSteps( p, st, dc, -1, -1, sDescription, uHash, true ); } @@ -264,7 +264,7 @@ XNode* StepsID::CreateNode() const pNode->AppendAttr( "StepsType", GameManager::StepsTypeToString(st) ); pNode->AppendAttr( "Difficulty", DifficultyToString(dc) ); - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { pNode->AppendAttr( "Description", sDescription ); pNode->AppendAttr( "Hash", uHash ); @@ -291,7 +291,7 @@ void StepsID::LoadFromNode( const XNode* pNode ) pNode->GetAttrValue("Difficulty", sTemp); dc = StringToDifficulty( sTemp ); - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { pNode->GetAttrValue("Description", sDescription); pNode->GetAttrValue("Hash", uHash); @@ -307,7 +307,7 @@ RString StepsID::ToString() const { RString s = GameManager::StepsTypeToString(st); s += " " + DifficultyToString(dc); - if( dc == DIFFICULTY_EDIT ) + if( dc == Difficulty_Edit ) { s += " " + sDescription; s += ssprintf(" %u", uHash ); diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index 8468a9736e..22ce72207b 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -327,7 +327,7 @@ UnlockEntryStatus UnlockEntry::GetUnlockEntryStatus() const m_pSong, vp, StepsType_Invalid, - DIFFICULTY_HARD + Difficulty_Hard ); FOREACH_CONST( Steps*, vp, s ) if( PROFILEMAN->GetMachineProfile()->HasPassedSteps( m_pSong, *s ) ) @@ -431,11 +431,11 @@ void UnlockManager::Load() FOREACH_CONST( Song*, SONGMAN->GetAllSongs(), s ) { // If no hard steps to play to unlock, skip - if( SongUtil::GetOneSteps(*s, StepsType_Invalid, DIFFICULTY_HARD) == NULL ) + if( SongUtil::GetOneSteps(*s, StepsType_Invalid, Difficulty_Hard) == NULL ) continue; // If no challenge steps to unlock, skip - if( SongUtil::GetOneSteps(*s, StepsType_Invalid, DIFFICULTY_CHALLENGE) == NULL ) + if( SongUtil::GetOneSteps(*s, StepsType_Invalid, Difficulty_Challenge) == NULL ) continue; if( SONGMAN->WasLoadedFromAdditionalSongs(*s) )