From de6ca466d25261f45830263ec62c85ee333a0156 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 7 Oct 2006 04:39:48 +0000 Subject: [PATCH] more enum standardization --- stepmania/src/CommonMetrics.cpp | 4 ++-- stepmania/src/Course.cpp | 12 ++++++------ stepmania/src/CourseEntryDisplay.cpp | 2 +- stepmania/src/CourseLoaderCRS.cpp | 4 ++-- stepmania/src/CourseWriterCRS.cpp | 2 +- stepmania/src/DateTime.h | 2 +- stepmania/src/Difficulty.cpp | 4 ++-- stepmania/src/Difficulty.h | 4 ++-- stepmania/src/DifficultyList.h | 2 +- stepmania/src/EditMenu.cpp | 8 ++++---- stepmania/src/GameCommand.cpp | 18 +++++++++--------- stepmania/src/GameConstantsAndTypes.cpp | 4 ++-- stepmania/src/GameConstantsAndTypes.h | 10 +++++----- stepmania/src/GameState.cpp | 14 +++++++------- stepmania/src/Grade.h | 4 ++-- stepmania/src/ModsGroup.h | 1 + stepmania/src/MusicBannerWheel.cpp | 2 +- stepmania/src/MusicWheel.cpp | 6 +++--- stepmania/src/NoteDataUtil.cpp | 8 ++++---- stepmania/src/NoteDataUtil.h | 2 +- stepmania/src/NoteTypes.cpp | 2 +- stepmania/src/NoteTypes.h | 2 +- stepmania/src/NotesWriterDWI.cpp | 4 ++-- stepmania/src/OptionRowHandler.cpp | 4 ++-- stepmania/src/PlayerNumber.h | 5 +++-- stepmania/src/PlayerStageStats.cpp | 14 +++++++------- stepmania/src/Profile.cpp | 4 ++-- stepmania/src/ScreenGameplay.cpp | 2 +- stepmania/src/ScreenJukebox.cpp | 2 +- stepmania/src/ScreenOptionsEditCourseEntry.cpp | 8 ++++---- stepmania/src/ScreenOptionsManageCourses.cpp | 2 +- stepmania/src/ScreenSelectMusic.cpp | 2 +- stepmania/src/SongUtil.cpp | 8 ++++---- stepmania/src/SongUtil.h | 4 ++-- stepmania/src/StageStats.cpp | 4 ++-- stepmania/src/StageStats.h | 2 +- stepmania/src/Steps.cpp | 6 +++--- stepmania/src/StepsUtil.cpp | 8 ++++---- stepmania/src/StepsUtil.h | 4 ++-- stepmania/src/Trail.h | 4 ++-- stepmania/src/TrailUtil.cpp | 6 +++--- stepmania/src/UnlockManager.cpp | 6 +++--- stepmania/src/UnlockManager.h | 2 +- 43 files changed, 110 insertions(+), 108 deletions(-) diff --git a/stepmania/src/CommonMetrics.cpp b/stepmania/src/CommonMetrics.cpp index 155a7ef0e9..e9578b1ca4 100644 --- a/stepmania/src/CommonMetrics.cpp +++ b/stepmania/src/CommonMetrics.cpp @@ -46,7 +46,7 @@ void ThemeMetricDifficultiesToShow::Read() FOREACH_CONST( RString, v, i ) { Difficulty d = StringToDifficulty( *i ); - if( d == DIFFICULTY_Invalid ) + if( d == Difficulty_Invalid ) RageException::Throw( "Unknown difficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() ); m_v.push_back( d ); } @@ -76,7 +76,7 @@ void ThemeMetricCourseDifficultiesToShow::Read() FOREACH_CONST( RString, v, i ) { CourseDifficulty d = StringToCourseDifficulty( *i ); - if( d == DIFFICULTY_Invalid ) + if( d == Difficulty_Invalid ) RageException::Throw( "Unknown CourseDifficulty \"%s\" in CourseDifficultiesToShow.", i->c_str() ); m_v.push_back( d ); } diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 813c060ab8..f540cd2553 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) ); @@ -263,7 +263,7 @@ RString Course::GetTranslitFullTitle() const * course difficulty doesn't exist, NULL is returned. */ Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const { - ASSERT( cd != DIFFICULTY_Invalid ); + ASSERT( cd != Difficulty_Invalid ); // // Check to see if the Trail cache is out of date @@ -543,7 +543,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) * on the original range, bump the steps based on course difficulty, and * then retroactively tweak the low_meter/high_meter so course displays * line up. */ - if( e->stepsCriteria.m_difficulty == DIFFICULTY_Invalid && bChangedDifficulty ) + if( e->stepsCriteria.m_difficulty == Difficulty_Invalid && bChangedDifficulty ) { /* Minimum and maximum to add to make the meter range contain the actual * meter: */ @@ -574,11 +574,11 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) te.iLowMeter = iLowMeter; te.iHighMeter = iHighMeter; - /* If we chose based on meter (not difficulty), then store DIFFICULTY_Invalid, so + /* If we chose based on meter (not difficulty), then store Difficulty_Invalid, so * other classes can tell that we used meter. */ - if( e->stepsCriteria.m_difficulty == DIFFICULTY_Invalid ) + if( e->stepsCriteria.m_difficulty == Difficulty_Invalid ) { - te.dc = DIFFICULTY_Invalid; + te.dc = Difficulty_Invalid; } else { diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index 1214ee497c..0e7c68b053 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -157,7 +157,7 @@ void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex ) } Difficulty dc = te->dc; - if( dc == DIFFICULTY_Invalid ) + if( dc == Difficulty_Invalid ) dc = DIFFICULTY_EDIT; SetDifficulty( pn, s, dc ); diff --git a/stepmania/src/CourseLoaderCRS.cpp b/stepmania/src/CourseLoaderCRS.cpp index 689c2f170b..457f11d5a2 100644 --- a/stepmania/src/CourseLoaderCRS.cpp +++ b/stepmania/src/CourseLoaderCRS.cpp @@ -73,7 +73,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou else if( sParams.params.size() == 3 ) { const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] ); - if( cd == DIFFICULTY_Invalid ) + if( cd == Difficulty_Invalid ) { LOG->UserLog( "Course file", sPath, "contains an invalid #METER string: \"%s\"", sParams[1].c_str() ); continue; @@ -202,7 +202,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou } new_entry.stepsCriteria.m_difficulty = StringToDifficulty( sParams[2] ); - if( new_entry.stepsCriteria.m_difficulty == DIFFICULTY_Invalid ) + if( new_entry.stepsCriteria.m_difficulty == Difficulty_Invalid ) { int retval = sscanf( sParams[2], "%d..%d", &new_entry.stepsCriteria.m_iLowMeter, &new_entry.stepsCriteria.m_iHighMeter ); if( retval == 1 ) diff --git a/stepmania/src/CourseWriterCRS.cpp b/stepmania/src/CourseWriterCRS.cpp index 384f91ca4e..9aa40a1737 100644 --- a/stepmania/src/CourseWriterCRS.cpp +++ b/stepmania/src/CourseWriterCRS.cpp @@ -119,7 +119,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin } f.Write( ":" ); - if( entry.stepsCriteria.m_difficulty != DIFFICULTY_Invalid ) + if( entry.stepsCriteria.m_difficulty != Difficulty_Invalid ) f.Write( DifficultyToString(entry.stepsCriteria.m_difficulty) ); else if( entry.stepsCriteria.m_iLowMeter != -1 && entry.stepsCriteria.m_iHighMeter != -1 ) f.Write( ssprintf( "%d..%d", entry.stepsCriteria.m_iLowMeter, entry.stepsCriteria.m_iHighMeter ) ); diff --git a/stepmania/src/DateTime.h b/stepmania/src/DateTime.h index 60bb7c1824..83e08a3c13 100644 --- a/stepmania/src/DateTime.h +++ b/stepmania/src/DateTime.h @@ -9,7 +9,7 @@ const int NUM_LAST_WEEKS = 52; const int DAYS_IN_YEAR = 366; // maximum (leap years) const int HOURS_IN_DAY = 24; const int DAYS_IN_WEEK = 7; -enum Month { NUM_Month = 12 }; +enum Month { NUM_Month = 12, Month_Invalid }; RString DayInYearToString( int iDayInYearIndex ); RString LastDayToString( int iLastDayIndex ); diff --git a/stepmania/src/Difficulty.cpp b/stepmania/src/Difficulty.cpp index 97f548524f..415dcd6498 100644 --- a/stepmania/src/Difficulty.cpp +++ b/stepmania/src/Difficulty.cpp @@ -44,7 +44,7 @@ Difficulty StringToDifficulty( const RString& sDC ) 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; + else return Difficulty_Invalid; } static const char *CourseDifficultyNames[] = @@ -69,7 +69,7 @@ CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd ) if( GAMESTATE->IsCourseDifficultyShown(d) ) return d; } - return DIFFICULTY_Invalid; + return Difficulty_Invalid; } /* diff --git a/stepmania/src/Difficulty.h b/stepmania/src/Difficulty.h index dc4fafa5ee..25da65ef26 100644 --- a/stepmania/src/Difficulty.h +++ b/stepmania/src/Difficulty.h @@ -15,7 +15,7 @@ enum Difficulty DIFFICULTY_CHALLENGE, DIFFICULTY_EDIT, NUM_Difficulty, - DIFFICULTY_Invalid + Difficulty_Invalid }; #define FOREACH_Difficulty( dc ) FOREACH_ENUM2( Difficulty, dc ) const RString& DifficultyToString( Difficulty dc ); @@ -27,7 +27,7 @@ LuaDeclareType( Difficulty ); typedef Difficulty CourseDifficulty; #define NUM_CourseDifficulty NUM_Difficulty #define FOREACH_CourseDifficulty FOREACH_Difficulty -#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_Invalid; cd=GetNextShownCourseDifficulty(cd) ) +#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=Difficulty_Invalid; cd=GetNextShownCourseDifficulty(cd) ) const RString& CourseDifficultyToString( Difficulty dc ); const RString& CourseDifficultyToLocalizedString( Difficulty dc ); diff --git a/stepmania/src/DifficultyList.h b/stepmania/src/DifficultyList.h index b4ab04bcc3..6e0a0390e9 100644 --- a/stepmania/src/DifficultyList.h +++ b/stepmania/src/DifficultyList.h @@ -56,7 +56,7 @@ private: Row() { m_Steps = NULL; - m_dc = DIFFICULTY_Invalid; + m_dc = Difficulty_Invalid; m_fY = 0; m_bHidden = false; } diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index c961c72536..9d90a7a4af 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -392,7 +392,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedStepsType()) ); { - Difficulty dcOld = DIFFICULTY_Invalid; + Difficulty dcOld = Difficulty_Invalid; if( !m_vpSteps.empty() ) dcOld = GetSelectedDifficulty(); @@ -506,7 +506,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedSourceStepsType()) ); m_vpSourceSteps.clear(); - m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,DIFFICULTY_Invalid) ); // "blank" + m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,Difficulty_Invalid) ); // "blank" FOREACH_Difficulty( dc ) { // fill in m_vpSourceSteps @@ -534,14 +534,14 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) m_textValue[ROW_SOURCE_STEPS].SetHidden( GetSelectedSteps() ? true : false ); { RString s; - if( GetSelectedSourceDifficulty() == DIFFICULTY_Invalid ) + if( GetSelectedSourceDifficulty() == Difficulty_Invalid ) s = BLANK; else s = DifficultyToLocalizedString(GetSelectedSourceDifficulty()); m_textValue[ROW_SOURCE_STEPS].SetText( s ); } bool bHideMeter = false; - if( GetSelectedSourceDifficulty() == DIFFICULTY_Invalid ) + if( GetSelectedSourceDifficulty() == Difficulty_Invalid ) bHideMeter = true; else if( GetSelectedSourceSteps() ) m_SourceMeter.SetFromSteps( GetSelectedSourceSteps() ); diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 8269f7eb2d..d80e660d50 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -38,8 +38,8 @@ void GameCommand::Init() m_MultiPlayer = MultiPlayer_Invalid; m_pStyle = NULL; m_pm = PlayMode_Invalid; - m_dc = DIFFICULTY_Invalid; - m_CourseDifficulty = DIFFICULTY_Invalid; + m_dc = Difficulty_Invalid; + m_CourseDifficulty = Difficulty_Invalid; m_sPreferredModifiers = ""; m_sStageModifiers = ""; m_sAnnouncer = ""; @@ -86,7 +86,7 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const // HACK: don't compare m_dc if m_pSteps is set. This causes problems // in ScreenSelectOptionsMaster::ImportOptions if m_PreferredDifficulty // doesn't match the difficulty of m_pCurSteps. - if( m_pSteps == NULL && m_dc != DIFFICULTY_Invalid ) + if( m_pSteps == NULL && m_dc != Difficulty_Invalid ) { // Why is this checking for all players? FOREACH_HumanPlayer( pn ) @@ -193,7 +193,7 @@ void GameCommand::LoadOne( const Command& cmd ) else if( sName == "difficulty" ) { Difficulty dc = StringToDifficulty( sValue ); - if( dc != DIFFICULTY_Invalid ) + if( dc != Difficulty_Invalid ) m_dc = dc; else m_bInvalid |= true; @@ -297,7 +297,7 @@ void GameCommand::LoadOne( const Command& cmd ) RageException::Throw( "Must set Course and Style to set Steps." ); const CourseDifficulty cd = StringToCourseDifficulty( sTrail ); - ASSERT_M( cd != DIFFICULTY_Invalid, ssprintf("Invalid difficulty '%s'", sTrail.c_str()) ); + ASSERT_M( cd != Difficulty_Invalid, ssprintf("Invalid difficulty '%s'", sTrail.c_str()) ); m_pTrail = pCourse->GetTrail( pStyle->m_StepsType, cd ); if( m_pTrail == NULL ) @@ -655,7 +655,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const ASSERT(0); } } - if( m_dc != DIFFICULTY_Invalid ) + if( m_dc != Difficulty_Invalid ) FOREACH_CONST( PlayerNumber, vpns, pn ) GAMESTATE->ChangePreferredDifficulty( *pn, m_dc ); if( m_sAnnouncer != "" ) @@ -697,7 +697,7 @@ void GameCommand::ApplySelf( const vector &vpns ) const if( m_pTrail ) FOREACH_CONST( PlayerNumber, vpns, pn ) GAMESTATE->m_pCurTrail[*pn].Set( m_pTrail ); - if( m_CourseDifficulty != DIFFICULTY_Invalid ) + if( m_CourseDifficulty != Difficulty_Invalid ) FOREACH_CONST( PlayerNumber, vpns, pn ) GAMESTATE->ChangePreferredCourseDifficulty( *pn, m_CourseDifficulty ); if( m_pCharacter ) @@ -781,7 +781,7 @@ bool GameCommand::IsZero() const { if( m_pm != PlayMode_Invalid || m_pStyle != NULL || - m_dc != DIFFICULTY_Invalid || + m_dc != Difficulty_Invalid || m_sAnnouncer != "" || m_sPreferredModifiers != "" || m_sStageModifiers != "" || @@ -790,7 +790,7 @@ bool GameCommand::IsZero() const m_pCourse != NULL || m_pTrail != NULL || m_pCharacter != NULL || - m_CourseDifficulty != DIFFICULTY_Invalid || + m_CourseDifficulty != Difficulty_Invalid || !m_sSongGroup.empty() || m_SortOrder != SortOrder_Invalid || m_iWeightPounds != -1 || diff --git a/stepmania/src/GameConstantsAndTypes.cpp b/stepmania/src/GameConstantsAndTypes.cpp index d7e8acb2fd..a1e847121e 100644 --- a/stepmania/src/GameConstantsAndTypes.cpp +++ b/stepmania/src/GameConstantsAndTypes.cpp @@ -168,7 +168,7 @@ TapNoteScore StringToTapNoteScore( const RString &s ) else if( s == "Perfect" ) return TNS_W2; else if( s == "Marvelous" ) return TNS_W1; - return TNS_Invalid; + return TapNoteScore_Invalid; } XToLocalizedString( TapNoteScore ); LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString(Enum::Check(L, 1)) ); @@ -192,7 +192,7 @@ HoldNoteScore StringToHoldNoteScore( const RString &s ) else if( s == "LetGo" ) return HNS_LetGo; else if( s == "Held" ) return HNS_Held; - return HNS_Invalid; + return HoldNoteScore_Invalid; } XToLocalizedString( HoldNoteScore ); diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index fdfad5cbcf..840f60bc1b 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -144,7 +144,7 @@ enum TapNoteScore { TNS_W2, TNS_W1, NUM_TapNoteScore, - TNS_Invalid, + TapNoteScore_Invalid, }; #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM2( TapNoteScore, tns ) const RString& TapNoteScoreToString( TapNoteScore tns ); @@ -159,7 +159,7 @@ enum HoldNoteScore HNS_LetGo, // the HoldNote has passed and they missed it HNS_Held, // the HoldNote has passed and was successfully held all the way through NUM_HoldNoteScore, - HNS_Invalid, + HoldNoteScore_Invalid, }; #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM2( HoldNoteScore, hns ) const RString& HoldNoteScoreToString( HoldNoteScore hns ); @@ -345,7 +345,7 @@ enum PerDifficultyAward AWARD_PERCENT_90_W3, AWARD_PERCENT_100_W3, NUM_PerDifficultyAward, - PER_DIFFICULTY_AWARD_Invalid, + PerDifficultyAward_Invalid, }; #define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM2( PerDifficultyAward, pma ) const RString& PerDifficultyAwardToString( PerDifficultyAward pma ); @@ -367,7 +367,7 @@ enum PeakComboAward AWARD_9000_PEAK_COMBO, AWARD_10000_PEAK_COMBO, NUM_PeakComboAward, - PEAK_COMBO_AWARD_Invalid, + PeakComboAward_Invalid, }; #define FOREACH_PeakComboAward( pca ) FOREACH_ENUM2( PeakComboAward, pca ) const RString& PeakComboAwardToString( PeakComboAward pma ); @@ -444,7 +444,7 @@ enum Stage STAGE_EVENT, STAGE_DEMO, NUM_Stage, - STAGE_Invalid, + Stage_Invalid, }; #define FOREACH_Stage( s ) FOREACH_ENUM2( Stage, s ) const RString& StageToString( Stage s ); diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 9769126217..b461e74d74 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -199,7 +199,7 @@ void GameState::Reset() m_bChangedFailTypeOnScreenSongOptions = false; FOREACH_PlayerNumber( p ) { - m_PreferredDifficulty[p].Set( DIFFICULTY_Invalid ); + m_PreferredDifficulty[p].Set( Difficulty_Invalid ); m_PreferredCourseDifficulty[p].Set( DIFFICULTY_MEDIUM ); } m_SortOrder.Set( SortOrder_Invalid ); @@ -392,9 +392,9 @@ void GameState::PlayersFinalized() // Only set the sort order if it wasn't already set by a GameCommand (or by an earlier profile) if( m_PreferredSortOrder == SortOrder_Invalid && pProfile->m_SortOrder != SortOrder_Invalid ) m_PreferredSortOrder = pProfile->m_SortOrder; - if( pProfile->m_LastDifficulty != DIFFICULTY_Invalid ) + if( pProfile->m_LastDifficulty != Difficulty_Invalid ) m_PreferredDifficulty[pn].Set( pProfile->m_LastDifficulty ); - if( pProfile->m_LastCourseDifficulty != DIFFICULTY_Invalid ) + if( pProfile->m_LastCourseDifficulty != Difficulty_Invalid ) m_PreferredCourseDifficulty[pn].Set( pProfile->m_LastCourseDifficulty ); if( m_pPreferredSong == NULL ) m_pPreferredSong = pProfile->m_lastSong.ToSong(); @@ -576,9 +576,9 @@ void GameState::SaveCurrentSettingsToProfile( PlayerNumber pn ) pProfile->SetDefaultModifiers( m_pCurGame, m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().GetSavedPrefsString() ); if( IsSongSort(m_PreferredSortOrder) ) pProfile->m_SortOrder = m_PreferredSortOrder; - if( m_PreferredDifficulty[pn] != DIFFICULTY_Invalid ) + if( m_PreferredDifficulty[pn] != Difficulty_Invalid ) pProfile->m_LastDifficulty = m_PreferredDifficulty[pn]; - if( m_PreferredCourseDifficulty[pn] != DIFFICULTY_Invalid ) + if( m_PreferredCourseDifficulty[pn] != Difficulty_Invalid ) pProfile->m_LastCourseDifficulty = m_PreferredCourseDifficulty[pn]; if( m_pPreferredSong ) pProfile->m_lastSong.FromSong( m_pPreferredSong ); @@ -1203,7 +1203,7 @@ SongOptions::FailType GameState::GetPlayerFailType( const PlayerState *pPlayerSt } else { - Difficulty dc = DIFFICULTY_Invalid; + Difficulty dc = Difficulty_Invalid; if( m_pCurSteps[pn] ) dc = m_pCurSteps[pn]->GetDifficulty(); @@ -1712,7 +1712,7 @@ bool GameState::IsCourseDifficultyShown( CourseDifficulty cd ) Difficulty GameState::GetEasiestStepsDifficulty() const { - Difficulty dc = DIFFICULTY_Invalid; + Difficulty dc = Difficulty_Invalid; FOREACH_HumanPlayer( p ) { if( m_pCurSteps[p] == NULL ) diff --git a/stepmania/src/Grade.h b/stepmania/src/Grade.h index edb1a58abb..36284f0f81 100644 --- a/stepmania/src/Grade.h +++ b/stepmania/src/Grade.h @@ -31,9 +31,9 @@ enum Grade Grade_Tier20, Grade_Failed, // = E NUM_Grade, - GRADE_Invalid, + Grade_Invalid, }; -#define Grade_NoData GRADE_Invalid +#define Grade_NoData Grade_Invalid /* This is in the header so the test sets don't require Grade.cpp (through PrefsManager), * since that pulls in ThemeManager. */ diff --git a/stepmania/src/ModsGroup.h b/stepmania/src/ModsGroup.h index 371b50e9ca..542fc3e914 100644 --- a/stepmania/src/ModsGroup.h +++ b/stepmania/src/ModsGroup.h @@ -10,6 +10,7 @@ enum ModsLevel ModsLevel_Stage, // Preferred + forced stage mods ModsLevel_Song, // Stage + forced attack mods NUM_ModsLevel, + ModsLevel_Invalid }; LuaDeclareType( ModsLevel ); diff --git a/stepmania/src/MusicBannerWheel.cpp b/stepmania/src/MusicBannerWheel.cpp index c4561c43d5..f00d092741 100644 --- a/stepmania/src/MusicBannerWheel.cpp +++ b/stepmania/src/MusicBannerWheel.cpp @@ -69,7 +69,7 @@ MusicBannerWheel::MusicBannerWheel() for ( unsigned i = 0; i < arraySongs.size(); i++) { //ONLY get non-autogenned steps - Steps* pSteps = SongUtil::GetStepsByDifficulty( arraySongs[i], GAMESTATE->GetCurrentStyle()->m_StepsType, DIFFICULTY_Invalid, false ); + Steps* pSteps = SongUtil::GetStepsByDifficulty( arraySongs[i], GAMESTATE->GetCurrentStyle()->m_StepsType, Difficulty_Invalid, false ); if ( pSteps != NULL ) pNotAutogen.push_back( arraySongs[i] ); } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 29b938bc72..3e0d58cc6a 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -742,7 +742,7 @@ void MusicWheel::UpdateSwitch() // // Change difficulty for sorts by meter - XXX: do this with GameCommand? // - Difficulty dc = DIFFICULTY_Invalid; + Difficulty dc = Difficulty_Invalid; switch( GAMESTATE->m_SortOrder ) { case SORT_EASY_METER: dc = DIFFICULTY_EASY; break; @@ -750,7 +750,7 @@ void MusicWheel::UpdateSwitch() case SORT_HARD_METER: dc = DIFFICULTY_HARD; break; case SORT_CHALLENGE_METER: dc = DIFFICULTY_CHALLENGE; break; } - if( dc != DIFFICULTY_Invalid ) + if( dc != Difficulty_Invalid ) { FOREACH_PlayerNumber( p ) if( GAMESTATE->IsPlayerEnabled(p) ) @@ -1053,7 +1053,7 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal() vector vDifficultiesToRequire; FOREACH_HumanPlayer(p) { - if( GAMESTATE->m_PreferredDifficulty[p] == DIFFICULTY_Invalid ) + if( GAMESTATE->m_PreferredDifficulty[p] == Difficulty_Invalid ) continue; // skip // TRICKY: Don't require that edits be present if perferred diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index 0d3d8dac82..deb543edf5 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -43,7 +43,7 @@ NoteType NoteDataUtil::GetSmallestNoteTypeForMeasure( const NoteData &n, int iMe } if( nt == NUM_NoteType ) // we didn't find one - return NOTE_TYPE_Invalid; // well-formed notes created in the editor should never get here + return NoteType_Invalid; // well-formed notes created in the editor should never get here else return nt; } @@ -337,7 +337,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in, RString &sRet ) NoteType nt = GetSmallestNoteTypeForMeasure( *nd, m ); int iRowSpacing; - if( nt == NOTE_TYPE_Invalid ) + if( nt == NoteType_Invalid ) iRowSpacing = 1; else iRowSpacing = int(roundf( NoteTypeToBeat(nt) * ROWS_PER_BEAT )); @@ -1644,11 +1644,11 @@ void NoteDataUtil::Stomp( NoteData &inout, StepsType st, int iStartIndex, int iE void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, int iStartIndex, int iEndIndex ) { - // nt2 is optional and should be NOTE_TYPE_Invalid if it is not used + // nt2 is optional and should be NoteType_Invalid if it is not used float fSnapInterval1 = NoteTypeToBeat( nt1 ); float fSnapInterval2 = 10000; // nothing will ever snap to this. That's what we want! - if( nt2 != NOTE_TYPE_Invalid ) + if( nt2 != NoteType_Invalid ) fSnapInterval2 = NoteTypeToBeat( nt2 ); // iterate over all TapNotes in the interval and snap them diff --git a/stepmania/src/NoteDataUtil.h b/stepmania/src/NoteDataUtil.h index 2dad8f9567..cac38d9dfb 100644 --- a/stepmania/src/NoteDataUtil.h +++ b/stepmania/src/NoteDataUtil.h @@ -91,7 +91,7 @@ namespace NoteDataUtil inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, int iStartIndex, int iEndIndex ) { - SnapToNearestNoteType( inout, nt, NOTE_TYPE_Invalid, iStartIndex, iEndIndex ); + SnapToNearestNoteType( inout, nt, NoteType_Invalid, iStartIndex, iEndIndex ); } // True if no notes in row that aren't true in the mask diff --git a/stepmania/src/NoteTypes.cpp b/stepmania/src/NoteTypes.cpp index ee31c6d2ca..b20474e2df 100644 --- a/stepmania/src/NoteTypes.cpp +++ b/stepmania/src/NoteTypes.cpp @@ -45,7 +45,7 @@ float NoteTypeToBeat( NoteType nt ) case NOTE_TYPE_64TH: return 1.0f/16; // sixty-fourth notes case NOTE_TYPE_192ND: return 1.0f/48; // sixty-fourth note triplets default: ASSERT(0); // and fall through - case NOTE_TYPE_Invalid: return 1.0f/48; + case NoteType_Invalid: return 1.0f/48; } } diff --git a/stepmania/src/NoteTypes.h b/stepmania/src/NoteTypes.h index 514182867b..33e6736f46 100644 --- a/stepmania/src/NoteTypes.h +++ b/stepmania/src/NoteTypes.h @@ -186,7 +186,7 @@ enum NoteType NOTE_TYPE_64TH, // sixty-fourth note NOTE_TYPE_192ND,// sixty-fourth note triplet NUM_NoteType, - NOTE_TYPE_Invalid + NoteType_Invalid }; const RString& NoteTypeToString( NoteType nt ); const RString& NoteTypeToLocalizedString( NoteType nt ); diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index 2be3022864..87710dcb32 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -223,7 +223,7 @@ void NotesWriterDWI::WriteDWINotesField( RageFile &f, const Steps &out, int star break; case NOTE_TYPE_48TH: case NOTE_TYPE_192ND: - case NOTE_TYPE_Invalid: + case NoteType_Invalid: // since, for whatever reason, the only way to do // 48ths is through a block of 192nds... f.Write( "`" ); @@ -300,7 +300,7 @@ void NotesWriterDWI::WriteDWINotesField( RageFile &f, const Steps &out, int star break; case NOTE_TYPE_48TH: case NOTE_TYPE_192ND: - case NOTE_TYPE_Invalid: + case NoteType_Invalid: f.Write( "'" ); break; default: diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 81083a0235..ba59cb62cf 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -675,13 +675,13 @@ class OptionRowHandlerListDifficulties: public OptionRowHandlerList { m_Def.m_bOneChoiceForAllPlayers = true; m_Def.m_sName = "Difficulty"; - m_Default.m_dc = DIFFICULTY_Invalid; + m_Default.m_dc = Difficulty_Invalid; m_Def.m_bAllowThemeItems = false; // we theme the text ourself { m_Def.m_vsChoices.push_back( "AllDifficulties" ); GameCommand mc; - mc.m_dc = DIFFICULTY_Invalid; + mc.m_dc = Difficulty_Invalid; m_aListEntries.push_back( mc ); } diff --git a/stepmania/src/PlayerNumber.h b/stepmania/src/PlayerNumber.h index f45e956ae9..5c11d186b7 100644 --- a/stepmania/src/PlayerNumber.h +++ b/stepmania/src/PlayerNumber.h @@ -14,9 +14,10 @@ enum PlayerNumber PLAYER_1 = 0, PLAYER_2, NUM_PlayerNumber, // leave this at the end - PLAYER_INVALID + PlayerNumber_Invalid }; -const int NUM_PLAYERS = NUM_PlayerNumber; +const PlayerNumber NUM_PLAYERS = NUM_PlayerNumber; +const PlayerNumber PLAYER_INVALID = PlayerNumber_Invalid; const RString& PlayerNumberToString( PlayerNumber pn ); const RString& PlayerNumberToLocalizedString( PlayerNumber pn ); LuaDeclareType( PlayerNumber ); diff --git a/stepmania/src/PlayerStageStats.cpp b/stepmania/src/PlayerStageStats.cpp index 3f609ffed3..31b0901b73 100644 --- a/stepmania/src/PlayerStageStats.cpp +++ b/stepmania/src/PlayerStageStats.cpp @@ -31,8 +31,8 @@ void PlayerStageStats::Init() iSongsPassed = iSongsPlayed = 0; fLifeRemainingSeconds = 0; fCaloriesBurned = 0; - tnsLast = TNS_Invalid; - hnsLast = HNS_Invalid; + tnsLast = TapNoteScore_Invalid; + hnsLast = HoldNoteScore_Invalid; ZERO( iTapNoteScores ); ZERO( iHoldNoteScores ); @@ -42,8 +42,8 @@ void PlayerStageStats::Init() fFirstSecond = FLT_MAX; fLastSecond = 0; - m_pdaToShow = PER_DIFFICULTY_AWARD_Invalid; - m_pcaToShow = PEAK_COMBO_AWARD_Invalid; + m_pdaToShow = PerDifficultyAward_Invalid; + m_pcaToShow = PeakComboAward_Invalid; m_iPersonalHighScoreIndex = -1; m_iMachineHighScoreIndex = -1; m_rc = RankingCategory_Invalid; @@ -528,7 +528,7 @@ void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutop { LOG->Trace( "hand out awards" ); - m_pcaToShow = PEAK_COMBO_AWARD_Invalid; + m_pcaToShow = PeakComboAward_Invalid; if( bGaveUp || bUsedAutoplay ) return; @@ -573,7 +573,7 @@ void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutop if( !vPdas.empty() ) m_pdaToShow = vPdas.back(); else - m_pdaToShow = PER_DIFFICULTY_AWARD_Invalid; + m_pdaToShow = PerDifficultyAward_Invalid; LOG->Trace( "done with per difficulty awards" ); @@ -593,7 +593,7 @@ void PlayerStageStats::CalcAwards( PlayerNumber p, bool bGaveUp, bool bUsedAutop if( !GAMESTATE->m_vLastPeakComboAwards[p].empty() ) m_pcaToShow = GAMESTATE->m_vLastPeakComboAwards[p].back(); else - m_pcaToShow = PEAK_COMBO_AWARD_Invalid; + m_pcaToShow = PeakComboAward_Invalid; LOG->Trace( "done with per combo awards" ); diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 68f2a6d1db..f902cc6398 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -100,8 +100,8 @@ void Profile::InitGeneralData() m_sGuid = MakeGuid(); m_SortOrder = SortOrder_Invalid; - m_LastDifficulty = DIFFICULTY_Invalid; - m_LastCourseDifficulty = DIFFICULTY_Invalid; + m_LastDifficulty = Difficulty_Invalid; + m_LastCourseDifficulty = Difficulty_Invalid; m_lastSong.Unset(); m_lastCourse.Unset(); m_iTotalPlays = 0; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 048e3716fb..a632ca40fb 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1297,7 +1297,7 @@ void ScreenGameplay::LoadLights() vector asDifficulties; split( sDifficulty, ",", asDifficulties ); - Difficulty d1 = DIFFICULTY_Invalid; + Difficulty d1 = Difficulty_Invalid; if( asDifficulties.size() > 0 ) d1 = StringToDifficulty( asDifficulties[0] ); pSteps = SongUtil::GetClosestNotes( GAMESTATE->m_pCurSong, GAMESTATE->GetCurrentStyle()->m_StepsType, d1 ); diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index c6b0e2eceb..c7f5f14da1 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -57,7 +57,7 @@ void ScreenJukebox::SetSong() } else { - if( GAMESTATE->m_PreferredDifficulty[PLAYER_1] != DIFFICULTY_Invalid ) + if( GAMESTATE->m_PreferredDifficulty[PLAYER_1] != Difficulty_Invalid ) { vDifficultiesToShow.push_back( GAMESTATE->m_PreferredDifficulty[PLAYER_1] ); } diff --git a/stepmania/src/ScreenOptionsEditCourseEntry.cpp b/stepmania/src/ScreenOptionsEditCourseEntry.cpp index d680244cd3..dbbbda9016 100644 --- a/stepmania/src/ScreenOptionsEditCourseEntry.cpp +++ b/stepmania/src/ScreenOptionsEditCourseEntry.cpp @@ -242,7 +242,7 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM ) Song *pSong = ce.pSong; Steps *pSteps; StepsType st = GAMESTATE->m_stEdit; - CourseDifficulty cd = ( ce.stepsCriteria.m_difficulty == DIFFICULTY_Invalid ? + CourseDifficulty cd = ( ce.stepsCriteria.m_difficulty == Difficulty_Invalid ? GAMESTATE->m_cdEdit : ce.stepsCriteria.m_difficulty ); if( pSong == NULL ) @@ -276,11 +276,11 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM ) // Try to find steps first using st and cd, then st, then cd, then any. pSteps = SongUtil::GetStepsByDifficulty( pSong, st, cd, false ); if( !pSteps ) - pSteps = SongUtil::GetStepsByDifficulty( pSong, st, DIFFICULTY_Invalid, false ); + pSteps = SongUtil::GetStepsByDifficulty( pSong, st, Difficulty_Invalid, false ); if( !pSteps ) pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, cd, false ); if( !pSteps ) - pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, DIFFICULTY_Invalid, false ); + pSteps = SongUtil::GetStepsByDifficulty( pSong, StepsType_Invalid, Difficulty_Invalid, false ); ASSERT( pSteps ); // Set up for ScreenEdit @@ -478,7 +478,7 @@ void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vectorm_stEdit == StepsType_Invalid || - GAMESTATE->m_cdEdit == DIFFICULTY_Invalid ) + GAMESTATE->m_cdEdit == Difficulty_Invalid ) { SetNextCombination(); } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 9e08e604ef..d213a003aa 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -804,7 +804,7 @@ void ScreenSelectMusic::SwitchToPreferredDifficulty() break; } - if( GAMESTATE->m_PreferredDifficulty[pn] != DIFFICULTY_Invalid ) + if( GAMESTATE->m_PreferredDifficulty[pn] != Difficulty_Invalid ) { int iDiff = abs(m_vpSteps[i]->GetDifficulty() - GAMESTATE->m_PreferredDifficulty[pn]); diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index 44de8c150c..7022d374ee 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -104,7 +104,7 @@ void SongUtil::GetSteps( { Steps* pSteps = vpSteps[i]; - if( dc != DIFFICULTY_Invalid && dc != pSteps->GetDifficulty() ) + if( dc != Difficulty_Invalid && dc != pSteps->GetDifficulty() ) continue; if( iMeterLow != -1 && iMeterLow > pSteps->GetMeter() ) continue; @@ -154,7 +154,7 @@ Steps* SongUtil::GetStepsByDifficulty( const Song *pSong, StepsType st, Difficul { Steps* pSteps = vpSteps[i]; - if( dc != DIFFICULTY_Invalid && dc != pSteps->GetDifficulty() ) + if( dc != Difficulty_Invalid && dc != pSteps->GetDifficulty() ) continue; if( !bIncludeAutoGen && pSteps->IsAutogen() ) continue; @@ -186,7 +186,7 @@ Steps* SongUtil::GetStepsByMeter( const Song *pSong, StepsType st, int iMeterLow Steps* SongUtil::GetStepsByDescription( const Song *pSong, StepsType st, RString sDescription ) { vector vNotes; - GetSteps( pSong, vNotes, st, DIFFICULTY_Invalid, -1, -1, sDescription ); + GetSteps( pSong, vNotes, st, Difficulty_Invalid, -1, -1, sDescription ); if( vNotes.size() == 0 ) return NULL; else @@ -196,7 +196,7 @@ Steps* SongUtil::GetStepsByDescription( const Song *pSong, StepsType st, RString Steps* SongUtil::GetClosestNotes( const Song *pSong, StepsType st, Difficulty dc, bool bIgnoreLocked ) { - ASSERT( dc != DIFFICULTY_Invalid ); + ASSERT( dc != Difficulty_Invalid ); const vector& vpSteps = (st == StepsType_Invalid)? pSong->GetAllSteps() : pSong->GetStepsByStepsType(st); Steps *pClosest = NULL; diff --git a/stepmania/src/SongUtil.h b/stepmania/src/SongUtil.h index 4bcf000de5..6bbe25511c 100644 --- a/stepmania/src/SongUtil.h +++ b/stepmania/src/SongUtil.h @@ -59,7 +59,7 @@ namespace SongUtil const Song *pSong, vector& arrayAddTo, StepsType st = StepsType_Invalid, - Difficulty dc = DIFFICULTY_Invalid, + Difficulty dc = Difficulty_Invalid, int iMeterLow = -1, int iMeterHigh = -1, const RString &sDescription = "", @@ -70,7 +70,7 @@ namespace SongUtil Steps* GetOneSteps( const Song *pSong, StepsType st = StepsType_Invalid, - Difficulty dc = DIFFICULTY_Invalid, + Difficulty dc = Difficulty_Invalid, int iMeterLow = -1, int iMeterHigh = -1, const RString &sDescription = "", diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index ddc8d97de5..da4dc31c63 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -22,7 +22,7 @@ StageStats::StageStats() pStyle = NULL; vpPlayedSongs.clear(); vpPossibleSongs.clear(); - StageType = STAGE_Invalid; + StageType = Stage_Invalid; bGaveUp = false; bUsedAutoplay = false; fGameplaySeconds = 0; @@ -88,7 +88,7 @@ void StageStats::AddStats( const StageStats& other ) vpPlayedSongs.push_back( *s ); FOREACH_CONST( Song*, other.vpPossibleSongs, s ) vpPossibleSongs.push_back( *s ); - StageType = STAGE_Invalid; // meaningless + StageType = Stage_Invalid; // meaningless bGaveUp |= other.bGaveUp; bUsedAutoplay |= other.bUsedAutoplay; diff --git a/stepmania/src/StageStats.h b/stepmania/src/StageStats.h index 9ba96da8ff..ed01fe73d8 100644 --- a/stepmania/src/StageStats.h +++ b/stepmania/src/StageStats.h @@ -31,7 +31,7 @@ public: const Style* pStyle; vector vpPlayedSongs; vector vpPossibleSongs; - enum { STAGE_Invalid, STAGE_NORMAL, STAGE_EXTRA, STAGE_EXTRA2 } StageType; + enum { Stage_Invalid, STAGE_NORMAL, STAGE_EXTRA, STAGE_EXTRA2 } StageType; bool bGaveUp; // exited gameplay by giving up bool bUsedAutoplay; // used autoplay at any point during gameplay diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 1881e5f6ab..7f6d615175 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -32,7 +32,7 @@ Steps::Steps() m_StepsType = StepsType_Invalid; m_LoadedFromProfile = ProfileSlot_Invalid; m_iHash = 0; - m_Difficulty = DIFFICULTY_Invalid; + m_Difficulty = Difficulty_Invalid; m_iMeter = 0; m_pNoteData = new NoteData; @@ -155,10 +155,10 @@ float Steps::PredictMeter() const void Steps::TidyUpData() { - if( GetDifficulty() == DIFFICULTY_Invalid ) + if( GetDifficulty() == Difficulty_Invalid ) SetDifficulty( StringToDifficulty(GetDescription()) ); - if( GetDifficulty() == DIFFICULTY_Invalid ) + if( GetDifficulty() == Difficulty_Invalid ) { if( GetMeter() == 1 ) SetDifficulty( DIFFICULTY_BEGINNER ); else if( GetMeter() <= 3 ) SetDifficulty( DIFFICULTY_EASY ); diff --git a/stepmania/src/StepsUtil.cpp b/stepmania/src/StepsUtil.cpp index 7c88cd0a5b..07bfc4d0a7 100644 --- a/stepmania/src/StepsUtil.cpp +++ b/stepmania/src/StepsUtil.cpp @@ -13,7 +13,7 @@ bool StepsCriteria::Matches( const Song *pSong, const Steps *pSteps ) const { - if( m_difficulty != DIFFICULTY_Invalid && pSteps->GetDifficulty() != m_difficulty ) + if( m_difficulty != Difficulty_Invalid && pSteps->GetDifficulty() != m_difficulty ) return false; if( m_iLowMeter != -1 && pSteps->GetMeter() < m_iLowMeter ) return false; @@ -191,7 +191,7 @@ void StepsID::FromSteps( const Steps *p ) if( p == NULL ) { st = StepsType_Invalid; - dc = DIFFICULTY_Invalid; + dc = Difficulty_Invalid; sDescription = ""; uHash = 0; } @@ -225,7 +225,7 @@ static map g_Cache; Steps *StepsID::ToSteps( const Song *p, bool bAllowNull, bool bUseCache ) const { - if( st == StepsType_Invalid || dc == DIFFICULTY_Invalid ) + if( st == StepsType_Invalid || dc == Difficulty_Invalid ) return NULL; SongID songID; @@ -317,7 +317,7 @@ RString StepsID::ToString() const bool StepsID::IsValid() const { - return st != StepsType_Invalid && dc != DIFFICULTY_Invalid; + return st != StepsType_Invalid && dc != Difficulty_Invalid; } bool StepsID::operator<( const StepsID &rhs ) const diff --git a/stepmania/src/StepsUtil.h b/stepmania/src/StepsUtil.h index 8121def7ad..7e77a73df0 100644 --- a/stepmania/src/StepsUtil.h +++ b/stepmania/src/StepsUtil.h @@ -13,7 +13,7 @@ class SongCriteria; class StepsCriteria { public: - Difficulty m_difficulty; // don't filter if DIFFICULTY_Invalid + Difficulty m_difficulty; // don't filter if Difficulty_Invalid int m_iLowMeter; // don't filter if -1 int m_iHighMeter; // don't filter if -1 StepsType m_st; // don't filter if StepsType_Invalid @@ -21,7 +21,7 @@ public: StepsCriteria() { - m_difficulty = DIFFICULTY_Invalid; + m_difficulty = Difficulty_Invalid; m_iLowMeter = -1; m_iHighMeter = -1; m_st = StepsType_Invalid; diff --git a/stepmania/src/Trail.h b/stepmania/src/Trail.h index 8b37979274..55e4d74c90 100644 --- a/stepmania/src/Trail.h +++ b/stepmania/src/Trail.h @@ -19,7 +19,7 @@ struct TrailEntry bSecret(false), iLowMeter(-1), iHighMeter(-1), - dc(DIFFICULTY_Invalid) + dc(Difficulty_Invalid) { } void GetAttackArray( AttackArray &out ) const; @@ -57,7 +57,7 @@ public: void Init() { m_StepsType = StepsType_Invalid; - m_CourseDifficulty = DIFFICULTY_Invalid; + m_CourseDifficulty = Difficulty_Invalid; m_iSpecifiedMeter = -1; m_vEntries.clear(); m_bRadarValuesCached = false; diff --git a/stepmania/src/TrailUtil.cpp b/stepmania/src/TrailUtil.cpp index a278d600b1..62af664242 100644 --- a/stepmania/src/TrailUtil.cpp +++ b/stepmania/src/TrailUtil.cpp @@ -11,7 +11,7 @@ void TrailID::FromTrail( const Trail *p ) if( p == NULL ) { st = StepsType_Invalid; - cd = DIFFICULTY_Invalid; + cd = Difficulty_Invalid; } else { @@ -24,7 +24,7 @@ Trail *TrailID::ToTrail( const Course *p, bool bAllowNull ) const { ASSERT( p ); - if( st == StepsType_Invalid || cd == DIFFICULTY_Invalid ) + if( st == StepsType_Invalid || cd == Difficulty_Invalid ) return NULL; Trail *ret = p->GetTrail( st, cd ); @@ -66,7 +66,7 @@ RString TrailID::ToString() const bool TrailID::IsValid() const { - return st != StepsType_Invalid && cd != DIFFICULTY_Invalid; + return st != StepsType_Invalid && cd != Difficulty_Invalid; } bool TrailID::operator<( const TrailID &rhs ) const diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index c543c55d83..449ac52c49 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -174,7 +174,7 @@ bool UnlockManager::ModifierIsLocked( const RString &sOneMod ) const const UnlockEntry *UnlockManager::FindSong( const Song *pSong ) const { FOREACH_CONST( UnlockEntry, m_UnlockEntries, e ) - if( e->m_pSong == pSong && e->m_dc == DIFFICULTY_Invalid ) + if( e->m_pSong == pSong && e->m_dc == Difficulty_Invalid ) return &(*e); return NULL; } @@ -294,7 +294,7 @@ bool UnlockEntry::IsValid() const return m_pSong != NULL; case UnlockRewardType_Steps: - return m_pSong != NULL && m_dc != DIFFICULTY_Invalid; + return m_pSong != NULL && m_dc != Difficulty_Invalid; case UnlockRewardType_Course: return m_pCourse != NULL; @@ -578,7 +578,7 @@ void UnlockManager::UpdateCachedPointers() } e->m_dc = StringToDifficulty( e->m_cmd.GetArg(2) ); - if( e->m_dc == DIFFICULTY_Invalid ) + if( e->m_dc == Difficulty_Invalid ) { LOG->Warn( "Unlock: Invalid difficulty \"%s\"", e->m_cmd.GetArg(2).s.c_str() ); break; diff --git a/stepmania/src/UnlockManager.h b/stepmania/src/UnlockManager.h index 64db68c84f..18f3f9004a 100644 --- a/stepmania/src/UnlockManager.h +++ b/stepmania/src/UnlockManager.h @@ -55,7 +55,7 @@ public: m_Type = UnlockRewardType_Invalid; m_pSong = NULL; - m_dc = DIFFICULTY_Invalid; + m_dc = Difficulty_Invalid; m_pCourse = NULL; ZERO( m_fRequirement );