enum name cleanup: DIFFICULTY_* -> Difficulty_*

This commit is contained in:
Chris Danford
2007-02-22 07:18:05 +00:00
parent 59df866348
commit f77647b5ad
34 changed files with 189 additions and 189 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ void BackgroundImpl::Init()
bOneOrMoreChars = true; bOneOrMoreChars = true;
// Disable dancing characters if BH will be showing. // Disable dancing characters if BH will be showing.
if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() && 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; bShowingBeginnerHelper = true;
} }
+14 -14
View File
@@ -64,7 +64,7 @@ RString CourseEntry::GetTextDescription() const
vsEntryDescription.push_back( songCriteria.m_sGroupName ); vsEntryDescription.push_back( songCriteria.m_sGroupName );
if( songCriteria.m_bUseSongGenreAllowedList ) if( songCriteria.m_bUseSongGenreAllowedList )
vsEntryDescription.push_back( join(",",songCriteria.m_vsSongGenreAllowedList) ); 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) ); vsEntryDescription.push_back( DifficultyToLocalizedString(stepsCriteria.m_difficulty) );
if( stepsCriteria.m_iLowMeter != -1 ) if( stepsCriteria.m_iLowMeter != -1 )
vsEntryDescription.push_back( ssprintf("Low meter: %d", stepsCriteria.m_iLowMeter) ); 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 ) 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. */ * must not change across difficulties. */
Trail SortTrail; Trail SortTrail;
if( cd == DIFFICULTY_MEDIUM ) if( cd == Difficulty_Medium )
SortTrail = trail; SortTrail = trail;
else 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( bOK );
} }
ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(), 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 ) switch( cd )
{ {
case DIFFICULTY_BEGINNER: case Difficulty_Beginner:
case DIFFICULTY_CHALLENGE: case Difficulty_Challenge:
return false; return false;
} }
@@ -443,7 +443,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
trail.m_CourseDifficulty = cd; trail.m_CourseDifficulty = cd;
/* Set to true if CourseDifficulty is able to change something. */ /* Set to true if CourseDifficulty is able to change something. */
bool bCourseDifficultyIsSignificant = (cd == DIFFICULTY_MEDIUM); bool bCourseDifficultyIsSignificant = (cd == Difficulty_Medium);
vector<Song*> vpAllPossibleSongs; vector<Song*> vpAllPossibleSongs;
vector<SongAndSteps> vSongAndSteps; vector<SongAndSteps> vSongAndSteps;
@@ -527,10 +527,10 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
Difficulty dc = resolved.pSteps->GetDifficulty(); Difficulty dc = resolved.pSteps->GetDifficulty();
int iLowMeter = e->stepsCriteria.m_iLowMeter; int iLowMeter = e->stepsCriteria.m_iLowMeter;
int iHighMeter = e->stepsCriteria.m_iHighMeter; 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); Difficulty new_dc = (Difficulty)(dc + cd - Difficulty_Medium);
new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(DIFFICULTY_EDIT-1) ); new_dc = clamp( new_dc, (Difficulty)0, (Difficulty)(Difficulty_Edit-1) );
bool bChangedDifficulty = false; bool bChangedDifficulty = false;
if( new_dc != dc ) if( new_dc != dc )
@@ -620,7 +620,7 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail )
trail.m_iSpecifiedMeter = m_iCustomMeter[cd]; trail.m_iSpecifiedMeter = m_iCustomMeter[cd];
/* If the course difficulty never actually changed anything, then this difficulty /* 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; return bCourseDifficultyIsSignificant;
} }
@@ -761,7 +761,7 @@ bool Course::GetTotalSeconds( StepsType st, float& fSecondsOut ) const
if( !AllSongsAreFixed() ) if( !AllSongsAreFixed() )
return false; return false;
Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM ); Trail* pTrail = GetTrail( st, Difficulty_Medium );
fSecondsOut = pTrail->GetLengthSeconds(); fSecondsOut = pTrail->GetLengthSeconds();
return true; return true;
@@ -801,7 +801,7 @@ void Course::UpdateCourseStats( StepsType st )
return; return;
} }
const Trail* pTrail = GetTrail( st, DIFFICULTY_MEDIUM ); const Trail* pTrail = GetTrail( st, Difficulty_Medium );
m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0; m_SortOrder_TotalDifficulty += pTrail != NULL? pTrail->GetTotalMeter():0;
+3 -3
View File
@@ -115,11 +115,11 @@ public:
RString GetTranslitFullTitle() const; RString GetTranslitFullTitle() const;
// Dereferences course_entries and returns only the playable Songs and Steps // Dereferences course_entries and returns only the playable Songs and Steps
Trail* GetTrail( 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; Trail* GetTrailForceRegenCache( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const;
void GetTrails( vector<Trail*> &AddTo, StepsType st ) const; void GetTrails( vector<Trail*> &AddTo, StepsType st ) const;
void GetAllTrails( vector<Trail*> &AddTo ) const; void GetAllTrails( vector<Trail*> &AddTo ) const;
int GetMeter( StepsType st, CourseDifficulty cd=DIFFICULTY_MEDIUM ) const; int GetMeter( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const;
bool HasMods() const; bool HasMods() const;
bool AllSongsAreFixed() const; bool AllSongsAreFixed() const;
+1 -1
View File
@@ -158,7 +158,7 @@ void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex )
Difficulty dc = te->dc; Difficulty dc = te->dc;
if( dc == Difficulty_Invalid ) if( dc == Difficulty_Invalid )
dc = DIFFICULTY_EDIT; dc = Difficulty_Edit;
SetDifficulty( pn, s, dc ); SetDifficulty( pn, s, dc );
} }
+1 -1
View File
@@ -87,7 +87,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
{ {
if( sParams.params.size() == 2 ) 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 ) else if( sParams.params.size() == 3 )
{ {
+2 -2
View File
@@ -148,7 +148,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCours
course_sort_val.clear(); course_sort_val.clear();
for( unsigned i = 0; i < vpCoursesInOut.size(); ++i ) 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 ); course_sort_val[vpCoursesInOut[i]] = ssprintf( "%06i", iMeter );
} }
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle ); sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTitle );
@@ -193,7 +193,7 @@ void CourseUtil::SortByMostRecentlyPlayedForMachine( vector<Course*> &vpCoursesI
void CourseUtil::MakeDefaultEditCourseEntry( CourseEntry& out ) void CourseUtil::MakeDefaultEditCourseEntry( CourseEntry& out )
{ {
out.pSong = GAMESTATE->GetDefaultSong(); out.pSong = GAMESTATE->GetDefaultSong();
out.stepsCriteria.m_difficulty = DIFFICULTY_MEDIUM; out.stepsCriteria.m_difficulty = Difficulty_Medium;
} }
////////////////////////////////// //////////////////////////////////
+18 -18
View File
@@ -29,24 +29,24 @@ Difficulty StringToDifficulty( const RString& sDC )
{ {
RString s2 = sDC; RString s2 = sDC;
s2.MakeLower(); s2.MakeLower();
if( s2 == "beginner" ) return DIFFICULTY_BEGINNER; if( s2 == "beginner" ) return Difficulty_Beginner;
else if( s2 == "easy" ) return DIFFICULTY_EASY; else if( s2 == "easy" ) return Difficulty_Easy;
else if( s2 == "basic" ) return DIFFICULTY_EASY; else if( s2 == "basic" ) return Difficulty_Easy;
else if( s2 == "light" ) return DIFFICULTY_EASY; else if( s2 == "light" ) return Difficulty_Easy;
else if( s2 == "medium" ) return DIFFICULTY_MEDIUM; else if( s2 == "medium" ) return Difficulty_Medium;
else if( s2 == "another" ) return DIFFICULTY_MEDIUM; else if( s2 == "another" ) return Difficulty_Medium;
else if( s2 == "trick" ) return DIFFICULTY_MEDIUM; else if( s2 == "trick" ) return Difficulty_Medium;
else if( s2 == "standard" ) return DIFFICULTY_MEDIUM; else if( s2 == "standard" ) return Difficulty_Medium;
else if( s2 == "difficult") return DIFFICULTY_MEDIUM; else if( s2 == "difficult") return Difficulty_Medium;
else if( s2 == "hard" ) return DIFFICULTY_HARD; else if( s2 == "hard" ) return Difficulty_Hard;
else if( s2 == "ssr" ) return DIFFICULTY_HARD; else if( s2 == "ssr" ) return Difficulty_Hard;
else if( s2 == "maniac" ) return DIFFICULTY_HARD; else if( s2 == "maniac" ) return Difficulty_Hard;
else if( s2 == "heavy" ) return DIFFICULTY_HARD; else if( s2 == "heavy" ) return Difficulty_Hard;
else if( s2 == "smaniac" ) return DIFFICULTY_CHALLENGE; else if( s2 == "smaniac" ) return Difficulty_Challenge;
else if( s2 == "challenge" )return DIFFICULTY_CHALLENGE; else if( s2 == "challenge" )return Difficulty_Challenge;
else if( s2 == "expert" ) return DIFFICULTY_CHALLENGE; else if( s2 == "expert" ) return Difficulty_Challenge;
else if( s2 == "oni" ) return DIFFICULTY_CHALLENGE; else if( s2 == "oni" ) return Difficulty_Challenge;
else if( s2 == "edit" ) return DIFFICULTY_EDIT; else if( s2 == "edit" ) return Difficulty_Edit;
else return Difficulty_Invalid; else return Difficulty_Invalid;
} }
+6 -6
View File
@@ -8,12 +8,12 @@
// //
enum Difficulty enum Difficulty
{ {
DIFFICULTY_BEGINNER, Difficulty_Beginner,
DIFFICULTY_EASY, Difficulty_Easy,
DIFFICULTY_MEDIUM, Difficulty_Medium,
DIFFICULTY_HARD, Difficulty_Hard,
DIFFICULTY_CHALLENGE, Difficulty_Challenge,
DIFFICULTY_EDIT, Difficulty_Edit,
NUM_Difficulty, NUM_Difficulty,
Difficulty_Invalid Difficulty_Invalid
}; };
+1 -1
View File
@@ -210,7 +210,7 @@ void DifficultyMeter::SetInternal( const SetParams &params )
if( m_bShowEditDescription ) if( m_bShowEditDescription )
{ {
if( params.dc == DIFFICULTY_EDIT ) if( params.dc == Difficulty_Edit )
{ {
m_textEditDescription.SetVisible( true ); m_textEditDescription.SetVisible( true );
m_textEditDescription.SetText( params.sEditDescription ); m_textEditDescription.SetText( params.sEditDescription );
+3 -3
View File
@@ -400,7 +400,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
{ {
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
switch( EDIT_MODE.GetValue() ) switch( EDIT_MODE.GetValue() )
{ {
@@ -409,7 +409,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
case EditMode_Practice: case EditMode_Practice:
{ {
vector<Steps*> v; vector<Steps*> v;
SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedStepsType(), DIFFICULTY_EDIT ); SongUtil::GetSteps( GetSelectedSong(), v, GetSelectedStepsType(), Difficulty_Edit );
StepsUtil::SortStepsByDescription( v ); StepsUtil::SortStepsByDescription( v );
FOREACH_CONST( Steps*, v, p ) FOREACH_CONST( Steps*, v, p )
m_vpSteps.push_back( StepsAndDifficulty(*p,dc) ); m_vpSteps.push_back( StepsAndDifficulty(*p,dc) );
@@ -510,7 +510,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
{ {
// fill in m_vpSourceSteps // fill in m_vpSourceSteps
if( dc != DIFFICULTY_EDIT ) if( dc != Difficulty_Edit )
{ {
Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedSourceStepsType(), dc ); Steps *pSteps = SongUtil::GetStepsByDifficulty( GetSelectedSong(), GetSelectedSourceStepsType(), dc );
if( pSteps != NULL ) if( pSteps != NULL )
+1 -1
View File
@@ -263,7 +263,7 @@ void GameCommand::LoadOne( const Command& cmd )
RageException::Throw( "Must set Song and Style to set Steps." ); RageException::Throw( "Must set Song and Style to set Steps." );
Difficulty dc = StringToDifficulty( sSteps ); Difficulty dc = StringToDifficulty( sSteps );
if( dc != DIFFICULTY_EDIT ) if( dc != Difficulty_Edit )
m_pSteps = SongUtil::GetStepsByDifficulty( pSong, pStyle->m_StepsType, dc ); m_pSteps = SongUtil::GetStepsByDifficulty( pSong, pStyle->m_StepsType, dc );
else else
m_pSteps = SongUtil::GetStepsByDescription( pSong, pStyle->m_StepsType, sSteps ); m_pSteps = SongUtil::GetStepsByDescription( pSong, pStyle->m_StepsType, sSteps );
+9 -9
View File
@@ -237,7 +237,7 @@ void GameState::Reset()
FOREACH_PlayerNumber( p ) FOREACH_PlayerNumber( p )
{ {
m_PreferredDifficulty[p].Set( Difficulty_Invalid ); m_PreferredDifficulty[p].Set( Difficulty_Invalid );
m_PreferredCourseDifficulty[p].Set( DIFFICULTY_MEDIUM ); m_PreferredCourseDifficulty[p].Set( Difficulty_Medium );
} }
m_SortOrder.Set( SortOrder_Invalid ); m_SortOrder.Set( SortOrder_Invalid );
m_PreferredSortOrder = GetDefaultSort(); m_PreferredSortOrder = GetDefaultSort();
@@ -1052,8 +1052,8 @@ bool GameState::HasEarnedExtraStage() const
FOREACH_EnabledPlayer( pn ) FOREACH_EnabledPlayer( pn )
{ {
if( m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_HARD && if( m_pCurSteps[pn]->GetDifficulty() != Difficulty_Hard &&
m_pCurSteps[pn]->GetDifficulty() != DIFFICULTY_CHALLENGE ) m_pCurSteps[pn]->GetDifficulty() != Difficulty_Challenge )
continue; /* not hard enough! */ continue; /* not hard enough! */
if( (IsFinalStage() && STATSMAN->m_CurStageStats.m_player[pn].GetGrade() <= GRADE_TIER_FOR_EXTRA_1) || 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; bool bFirstStage = !IsEventMode() && m_iCurrentStageIndex == 0;
/* Easy and beginner are never harder than FAIL_IMMEDIATE_CONTINUE. */ /* Easy and beginner are never harder than FAIL_IMMEDIATE_CONTINUE. */
if( dc <= DIFFICULTY_EASY ) if( dc <= Difficulty_Easy )
setmax( ft, SongOptions::FAIL_IMMEDIATE_CONTINUE ); 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 ); setmax( ft, SongOptions::FAIL_OFF );
/* If beginner's steps were chosen, and this is the first stage, /* If beginner's steps were chosen, and this is the first stage,
* turn off failure completely. */ * turn off failure completely. */
if( dc == DIFFICULTY_BEGINNER && bFirstStage ) if( dc == Difficulty_Beginner && bFirstStage )
setmax( ft, SongOptions::FAIL_OFF ); setmax( ft, SongOptions::FAIL_OFF );
if( dc == DIFFICULTY_BEGINNER && PREFSMAN->m_bFailOffInBeginner ) if( dc == Difficulty_Beginner && PREFSMAN->m_bFailOffInBeginner )
setmax( ft, SongOptions::FAIL_OFF ); setmax( ft, SongOptions::FAIL_OFF );
} }
@@ -1483,7 +1483,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
feat.Type = RankingFeat::COURSE; feat.Type = RankingFeat::COURSE;
feat.pCourse = pCourse; feat.pCourse = pCourse;
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() ); 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.Feat += " " + CourseDifficultyToLocalizedString(cd);
feat.pStringToFill = hs.GetNameMutable(); feat.pStringToFill = hs.GetNameMutable();
feat.grade = Grade_NoData; 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, /* 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 Difficulty GameState::GetClosestShownDifficulty( PlayerNumber pn ) const
{ {
const vector<Difficulty> &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(); const vector<Difficulty> &v = CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue();
+1 -1
View File
@@ -110,7 +110,7 @@ void LifeMeterBar::Load( const PlayerState *pPlayerState, PlayerStageStats *pPla
bool bMercifulBeginnerInEffect = bool bMercifulBeginnerInEffect =
GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR && GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR &&
GAMESTATE->IsPlayerEnabled( pPlayerState ) && GAMESTATE->IsPlayerEnabled( pPlayerState ) &&
GAMESTATE->m_pCurSteps[pn]->GetDifficulty() == DIFFICULTY_BEGINNER && GAMESTATE->m_pCurSteps[pn]->GetDifficulty() == Difficulty_Beginner &&
PREFSMAN->m_bMercifulBeginner; PREFSMAN->m_bMercifulBeginner;
if( bMercifulBeginnerInEffect ) if( bMercifulBeginnerInEffect )
{ {
+24 -24
View File
@@ -72,8 +72,8 @@ RString ModeSwitcher::GetStyleName()
{ {
switch( GAMESTATE->m_PreferredDifficulty[i].Get() ) switch( GAMESTATE->m_PreferredDifficulty[i].Get() )
{ {
case DIFFICULTY_BEGINNER: sDiff[i] = "Beginner\n"; break; case Difficulty_Beginner: sDiff[i] = "Beginner\n"; break;
case DIFFICULTY_EASY: case Difficulty_Easy:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -84,7 +84,7 @@ RString ModeSwitcher::GetStyleName()
sDiff[i] = "Light\n"; break; sDiff[i] = "Light\n"; break;
} }
} }
case DIFFICULTY_MEDIUM: case Difficulty_Medium:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -95,7 +95,7 @@ RString ModeSwitcher::GetStyleName()
sDiff[i] = "Standard\n"; break; sDiff[i] = "Standard\n"; break;
} }
} }
case DIFFICULTY_HARD: case Difficulty_Hard:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -106,7 +106,7 @@ RString ModeSwitcher::GetStyleName()
sDiff[i] = "Heavy\n"; break; 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; default: sDiff[i] = ""; break;
} }
} }
@@ -129,14 +129,14 @@ RString ModeSwitcher::GetNextStyleName()
{ {
if(GAMESTATE->IsPlayerEnabled(i)) 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] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i]) switch(GAMESTATE->m_PreferredDifficulty[i])
{ {
case DIFFICULTY_BEGINNER: case Difficulty_Beginner:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -147,7 +147,7 @@ RString ModeSwitcher::GetNextStyleName()
sDiff[i] = "Light\n"; break; sDiff[i] = "Light\n"; break;
} }
} }
case DIFFICULTY_EASY: case Difficulty_Easy:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -158,7 +158,7 @@ RString ModeSwitcher::GetNextStyleName()
sDiff[i] = "Standard\n"; break; sDiff[i] = "Standard\n"; break;
} }
} }
case DIFFICULTY_MEDIUM: case Difficulty_Medium:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -169,8 +169,8 @@ RString ModeSwitcher::GetNextStyleName()
sDiff[i] = "Heavy\n"; break; sDiff[i] = "Heavy\n"; break;
} }
} }
case DIFFICULTY_HARD: sDiff[i] = "Challenge\n"; break; case Difficulty_Hard: sDiff[i] = "Challenge\n"; break;
case DIFFICULTY_CHALLENGE: sDiff[i] = "Beginner\n"; break; case Difficulty_Challenge: sDiff[i] = "Beginner\n"; break;
default: sDiff[i] = ""; break; default: sDiff[i] = ""; break;
} }
} }
@@ -202,14 +202,14 @@ RString ModeSwitcher::GetPrevStyleName()
{ {
if(GAMESTATE->IsPlayerEnabled(i)) 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] = GAMESTATE->GetCurrentStyle()->m_szName;
sStyleName[i].MakeUpper(); sStyleName[i].MakeUpper();
switch(GAMESTATE->m_PreferredDifficulty[i]) switch(GAMESTATE->m_PreferredDifficulty[i])
{ {
case DIFFICULTY_CHALLENGE: case Difficulty_Challenge:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -220,8 +220,8 @@ RString ModeSwitcher::GetPrevStyleName()
sDiff[i] = "Heavy\n"; break; sDiff[i] = "Heavy\n"; break;
} }
} }
case DIFFICULTY_EASY: sDiff[i] = "Beginner\n"; break; case Difficulty_Easy: sDiff[i] = "Beginner\n"; break;
case DIFFICULTY_MEDIUM: case Difficulty_Medium:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -232,7 +232,7 @@ RString ModeSwitcher::GetPrevStyleName()
sDiff[i] = "Light\n"; break; sDiff[i] = "Light\n"; break;
} }
} }
case DIFFICULTY_HARD: case Difficulty_Hard:
{ {
if(GAMESTATE->m_pCurGame->m_szName == RString("pump")) if(GAMESTATE->m_pCurGame->m_szName == RString("pump"))
{ {
@@ -243,7 +243,7 @@ RString ModeSwitcher::GetPrevStyleName()
sDiff[i] = "Standard\n"; break; 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; default: sDiff[i] = ""; break;
} }
} }
@@ -272,14 +272,14 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir)
{ {
if(GAMESTATE->IsPlayerEnabled(pn)) if(GAMESTATE->IsPlayerEnabled(pn))
{ {
if(GAMESTATE->m_PreferredDifficulty[pn] != DIFFICULTY_CHALLENGE) if(GAMESTATE->m_PreferredDifficulty[pn] != Difficulty_Challenge)
{ {
switch(GAMESTATE->m_PreferredDifficulty[pn]) switch(GAMESTATE->m_PreferredDifficulty[pn])
{ {
case DIFFICULTY_BEGINNER: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_EASY ); 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_Easy: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Medium ); break;
case DIFFICULTY_MEDIUM: GAMESTATE->m_PreferredDifficulty[pn].Set( DIFFICULTY_HARD ); 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_Hard: GAMESTATE->m_PreferredDifficulty[pn].Set( Difficulty_Challenge ); break;
} }
m_Stylename.SetText(GetStyleName()); m_Stylename.SetText(GetStyleName());
m_Nextmode.SetText(GetNextStyleName()); m_Nextmode.SetText(GetNextStyleName());
@@ -289,9 +289,9 @@ void ModeSwitcher::ChangeMode(PlayerNumber pn, int dir)
else else
{ {
if(GAMESTATE->IsPlayerEnabled(PLAYER_1)) 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)) if(GAMESTATE->IsPlayerEnabled(PLAYER_2))
GAMESTATE->m_PreferredDifficulty[PLAYER_2].Set( DIFFICULTY_CHALLENGE ); GAMESTATE->m_PreferredDifficulty[PLAYER_2].Set( Difficulty_Challenge );
} }
} }
+11 -11
View File
@@ -433,7 +433,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData *> &arrayWheelItemDat
// obey order specified by the preferred sort list // obey order specified by the preferred sort list
break; break;
case SORT_ROULETTE: case SORT_ROULETTE:
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY ); SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Easy );
if( (bool)PREFSMAN->m_bPreferredSortUsesGroups ) if( (bool)PREFSMAN->m_bPreferredSortUsesGroups )
stable_sort( arraySongs.begin(), arraySongs.end(), SongUtil::CompareSongPointersByGroup ); stable_sort( arraySongs.begin(), arraySongs.end(), SongUtil::CompareSongPointersByGroup );
bUseSections = false; bUseSections = false;
@@ -463,16 +463,16 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData *> &arrayWheelItemDat
SongUtil::SortSongPointerArrayByGenre( arraySongs ); SongUtil::SortSongPointerArrayByGenre( arraySongs );
break; break;
case SORT_EASY_METER: case SORT_EASY_METER:
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_EASY ); SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Easy );
break; break;
case SORT_MEDIUM_METER: case SORT_MEDIUM_METER:
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_MEDIUM ); SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Medium );
break; break;
case SORT_HARD_METER: case SORT_HARD_METER:
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_HARD ); SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Hard );
break; break;
case SORT_CHALLENGE_METER: case SORT_CHALLENGE_METER:
SongUtil::SortSongPointerArrayByMeter( arraySongs, DIFFICULTY_CHALLENGE ); SongUtil::SortSongPointerArrayByMeter( arraySongs, Difficulty_Challenge );
break; break;
default: default:
ASSERT(0); // unhandled SortOrder ASSERT(0); // unhandled SortOrder
@@ -737,10 +737,10 @@ void MusicWheel::UpdateSwitch()
Difficulty dc = Difficulty_Invalid; Difficulty dc = Difficulty_Invalid;
switch( GAMESTATE->m_SortOrder ) switch( GAMESTATE->m_SortOrder )
{ {
case SORT_EASY_METER: dc = DIFFICULTY_EASY; break; case SORT_EASY_METER: dc = Difficulty_Easy; break;
case SORT_MEDIUM_METER: dc = DIFFICULTY_MEDIUM; break; case SORT_MEDIUM_METER: dc = Difficulty_Medium; break;
case SORT_HARD_METER: dc = DIFFICULTY_HARD; break; case SORT_HARD_METER: dc = Difficulty_Hard; break;
case SORT_CHALLENGE_METER: dc = DIFFICULTY_CHALLENGE; break; case SORT_CHALLENGE_METER: dc = Difficulty_Challenge; break;
} }
if( dc != Difficulty_Invalid ) if( dc != Difficulty_Invalid )
{ {
@@ -1049,10 +1049,10 @@ Song *MusicWheel::GetPreferredSelectionForRandomOrPortal()
continue; // skip continue; // skip
// TRICKY: Don't require that edits be present if perferred // 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 // to set up a 100% chance of getting a particular locked song by
// having a single edit for a locked song. // having a single edit for a locked song.
if( GAMESTATE->m_PreferredDifficulty[p] == DIFFICULTY_EDIT ) if( GAMESTATE->m_PreferredDifficulty[p] == Difficulty_Edit )
continue; // skip continue; // skip
vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] ); vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] );
+13 -13
View File
@@ -274,16 +274,16 @@ static void SearchForDifficulty( RString sTag, Steps *pOut )
/* Only match "Light" in parentheses. */ /* Only match "Light" in parentheses. */
if( sTag.find( "(light" ) != sTag.npos ) if( sTag.find( "(light" ) != sTag.npos )
{ {
pOut->SetDifficulty( DIFFICULTY_EASY ); pOut->SetDifficulty( Difficulty_Easy );
} }
else if( sTag.find( "another" ) != sTag.npos ) else if( sTag.find( "another" ) != sTag.npos )
{ {
pOut->SetDifficulty( DIFFICULTY_HARD ); pOut->SetDifficulty( Difficulty_Hard );
} }
else if( sTag.find( "(solo)" ) != sTag.npos ) else if( sTag.find( "(solo)" ) != sTag.npos )
{ {
pOut->SetDescription( "Solo" ); 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() ); 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 ) FOREACH_Difficulty( dc )
{ {
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
continue; continue;
vector<Steps*> vSteps; vector<Steps*> vSteps;
@@ -945,7 +945,7 @@ static void SlideDuplicateDifficulties( Song &p )
{ {
Steps* pSteps = vSteps[k]; Steps* pSteps = vSteps[k];
Difficulty dc2 = min( (Difficulty)(dc+1), DIFFICULTY_CHALLENGE ); Difficulty dc2 = min( (Difficulty)(dc+1), Difficulty_Challenge );
pSteps->SetDifficulty( dc2 ); pSteps->SetDifficulty( dc2 );
} }
} }
@@ -999,7 +999,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
for( unsigned i=0; i<aBMSData.size(); i++ ) for( unsigned i=0; i<aBMSData.size(); i++ )
{ {
Steps *pSteps = apSteps[i]; Steps *pSteps = apSteps[i];
pSteps->SetDifficulty( DIFFICULTY_MEDIUM ); pSteps->SetDifficulty( Difficulty_Medium );
RString sTag; RString sTag;
if( GetTagFromMap( aBMSData[i], "#title", sTag ) && sTag.size() != commonSubstring.size() ) 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" ) if( lPos > 2 && sTag.substr(lPos-2,4) == "solo" )
{ {
// (solo) -- an edit, apparently (Thanks Glenn!) // (solo) -- an edit, apparently (Thanks Glenn!)
pSteps->SetDifficulty( DIFFICULTY_EDIT ); pSteps->SetDifficulty( Difficulty_Edit );
} }
else else
{ {
// Any of [L7] [L14] (LIGHT7) (LIGHT14) (LIGHT) [L] <LIGHT7> <L7>... you get the idea. // Any of [L7] [L14] (LIGHT7) (LIGHT14) (LIGHT) [L] <LIGHT7> <L7>... you get the idea.
pSteps->SetDifficulty( DIFFICULTY_EASY ); pSteps->SetDifficulty( Difficulty_Easy );
} }
} }
// [A] <A> (A) [ANOTHER] <ANOTHER> (ANOTHER) (ANOTHER7) Another (DP ANOTHER) (Another) -ANOTHER- [A7] [A14] etc etc etc // [A] <A> (A) [ANOTHER] <ANOTHER> (ANOTHER) (ANOTHER7) Another (DP ANOTHER) (Another) -ANOTHER- [A7] [A14] etc etc etc
else if( sTag.find('a') != sTag.npos ) 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] // XXX: Can also match (double), but should match [B] or [B7]
else if( sTag.find('b') != sTag.npos ) 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) // 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? // 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? // XXX: Is this really effective if Common Substring parsing failed?
Steps *pSteps = apSteps[i]; Steps *pSteps = apSteps[i];
pSteps->SetDifficulty( DIFFICULTY_MEDIUM ); pSteps->SetDifficulty( Difficulty_Medium );
RString sTag; RString sTag;
if( GetTagFromMap( aBMSData[i], "#title", sTag ) ) if( GetTagFromMap( aBMSData[i], "#title", sTag ) )
SearchForDifficulty( sTag, pSteps ); 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 * have the least cruft in the #TITLE tag, so it's more likely to get a clean
* title. */ * title. */
int iMainDataIndex = 0; int iMainDataIndex = 0;
for( unsigned i=1; i<apSteps.size(); i++ ) for( unsigned i=1; i<apSteps.size(); i++ )
if( apSteps[i]->GetDifficulty() == DIFFICULTY_MEDIUM ) if( apSteps[i]->GetDifficulty() == Difficulty_Medium )
iMainDataIndex = i; iMainDataIndex = i;
MeasureToTimeSig_t sigAdjustments; MeasureToTimeSig_t sigAdjustments;
+4 -4
View File
@@ -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 || if( sFName.find("crazy") != string::npos || sFName.find("nightmare") != string::npos ||
sFName.find("crazydouble") != 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. 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 || else if( sFName.find("hard") != string::npos || sFName.find("freestyle") != string::npos ||
sFName.find("double") != string::npos ) sFName.find("double") != string::npos )
{ {
out.SetDifficulty( DIFFICULTY_MEDIUM ); out.SetDifficulty( Difficulty_Medium );
if( !out.GetMeter() ) out.SetMeter( 8 ); if( !out.GetMeter() ) out.SetMeter( 8 );
} }
else if( sFName.find("easy") != string::npos || sFName.find("normal") != string::npos ) 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 ); if( !out.GetMeter() ) out.SetMeter( 4 );
} }
else else
{ {
out.SetDifficulty( DIFFICULTY_MEDIUM ); out.SetDifficulty( Difficulty_Medium );
if( !out.GetMeter() ) out.SetMeter( 8 ); if( !out.GetMeter() ) out.SetMeter( 8 );
} }
+7 -7
View File
@@ -36,14 +36,14 @@ static void LoadFromSMTokens(
out.SetDescription( sDescription ); out.SetDescription( sDescription );
out.SetDifficulty( StringToDifficulty(sDifficulty) ); out.SetDifficulty( StringToDifficulty(sDifficulty) );
// HACK: We used to store SMANIAC as DIFFICULTY_HARD with special description. // HACK: We used to store SMANIAC as Difficulty_Hard with special description.
// Now, it has its own DIFFICULTY_CHALLENGE // Now, it has its own Difficulty_Challenge
if( sDescription.CompareNoCase("smaniac") == 0 ) if( sDescription.CompareNoCase("smaniac") == 0 )
out.SetDifficulty( DIFFICULTY_CHALLENGE ); out.SetDifficulty( Difficulty_Challenge );
// HACK: We used to store CHALLENGE as DIFFICULTY_HARD with special description. // HACK: We used to store CHALLENGE as Difficulty_Hard with special description.
// Now, it has its own DIFFICULTY_CHALLENGE // Now, it has its own Difficulty_Challenge
if( sDescription.CompareNoCase("challenge") == 0 ) if( sDescription.CompareNoCase("challenge") == 0 )
out.SetDifficulty( DIFFICULTY_CHALLENGE ); out.SetDifficulty( Difficulty_Challenge );
out.SetMeter( atoi(sMeter) ); out.SetMeter( atoi(sMeter) );
vector<RString> saValues; vector<RString> saValues;
@@ -540,7 +540,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
*pNewNotes); *pNewNotes);
pNewNotes->SetLoadedFromProfile( slot ); pNewNotes->SetLoadedFromProfile( slot );
pNewNotes->SetDifficulty( DIFFICULTY_EDIT ); pNewNotes->SetDifficulty( Difficulty_Edit );
pNewNotes->SetFilename( sEditFilePath ); pNewNotes->SetFilename( sEditFilePath );
if( pSong->IsEditAlreadyLoaded(pNewNotes) ) if( pSong->IsEditAlreadyLoaded(pNewNotes) )
+6 -6
View File
@@ -315,7 +315,7 @@ static void WriteDWINotesField( RageFile &f, const Steps &out, int start )
static bool WriteDWINotesTag( RageFile &f, const Steps &out ) static bool WriteDWINotesTag( RageFile &f, const Steps &out )
{ {
if( out.GetDifficulty() == DIFFICULTY_EDIT ) if( out.GetDifficulty() == Difficulty_Edit )
return false; // not supported by DWI return false; // not supported by DWI
/* Flush dir cache when writing steps, so the old size isn't cached. */ /* 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() ) switch( out.GetDifficulty() )
{ {
case DIFFICULTY_BEGINNER: f.Write( "BEGINNER:" ); break; case Difficulty_Beginner: f.Write( "BEGINNER:" ); break;
case DIFFICULTY_EASY: f.Write( "BASIC:" ); break; case Difficulty_Easy: f.Write( "BASIC:" ); break;
case DIFFICULTY_MEDIUM: f.Write( "ANOTHER:" ); break; case Difficulty_Medium: f.Write( "ANOTHER:" ); break;
case DIFFICULTY_HARD: f.Write( "MANIAC:" ); break; case Difficulty_Hard: f.Write( "MANIAC:" ); break;
case DIFFICULTY_CHALLENGE: f.Write( "SMANIAC:" ); break; case Difficulty_Challenge: f.Write( "SMANIAC:" ); break;
default: ASSERT(0); return false; default: ASSERT(0); return false;
} }
+7 -7
View File
@@ -397,7 +397,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList
Steps* pSteps = vpSteps[i]; Steps* pSteps = vpSteps[i];
RString s; RString s;
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( pSteps->GetDifficulty() == Difficulty_Edit )
s = pSteps->GetDescription(); s = pSteps->GetDescription();
else else
s = DifficultyToLocalizedString( pSteps->GetDifficulty() ); s = DifficultyToLocalizedString( pSteps->GetDifficulty() );
@@ -482,19 +482,19 @@ public:
{ {
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
{ {
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
continue; continue;
m_vDifficulties.push_back( dc ); m_vDifficulties.push_back( dc );
Steps* pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, *m_pst, dc ); Steps* pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, *m_pst, dc );
m_vSteps.push_back( pSteps ); m_vSteps.push_back( pSteps );
} }
SongUtil::GetSteps( GAMESTATE->m_pCurSong, m_vSteps, *m_pst, DIFFICULTY_EDIT ); SongUtil::GetSteps( GAMESTATE->m_pCurSong, m_vSteps, *m_pst, Difficulty_Edit );
m_vDifficulties.resize( m_vSteps.size(), DIFFICULTY_EDIT ); m_vDifficulties.resize( m_vSteps.size(), Difficulty_Edit );
if( sParam == "EditSteps" ) if( sParam == "EditSteps" )
{ {
m_vSteps.push_back( NULL ); m_vSteps.push_back( NULL );
m_vDifficulties.push_back( DIFFICULTY_EDIT ); m_vDifficulties.push_back( Difficulty_Edit );
} }
for( unsigned i=0; i<m_vSteps.size(); i++ ) for( unsigned i=0; i<m_vSteps.size(); i++ )
@@ -503,7 +503,7 @@ public:
Difficulty dc = m_vDifficulties[i]; Difficulty dc = m_vDifficulties[i];
RString s; RString s;
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
if( pSteps ) if( pSteps )
s = pSteps->GetDescription(); s = pSteps->GetDescription();
@@ -519,7 +519,7 @@ public:
} }
else else
{ {
m_vDifficulties.push_back( DIFFICULTY_EDIT ); m_vDifficulties.push_back( Difficulty_Edit );
m_vSteps.push_back( NULL ); m_vSteps.push_back( NULL );
m_Def.m_vsChoices.push_back( "none" ); m_Def.m_vsChoices.push_back( "none" );
} }
+2 -2
View File
@@ -2494,7 +2494,7 @@ bool Player::IsPlayingBeginner() const
if( m_pPlayerStageStats != NULL && !m_pPlayerStageStats->m_vpPossibleSteps.empty() ) if( m_pPlayerStageStats != NULL && !m_pPlayerStageStats->m_vpPossibleSteps.empty() )
{ {
Steps *pSteps = m_pPlayerStageStats->m_vpPossibleSteps[0]; Steps *pSteps = m_pPlayerStageStats->m_vpPossibleSteps[0];
return pSteps->GetDifficulty() == DIFFICULTY_BEGINNER; return pSteps->GetDifficulty() == Difficulty_Beginner;
} }
if( m_pPlayerState == NULL ) if( m_pPlayerState == NULL )
@@ -2503,7 +2503,7 @@ bool Player::IsPlayingBeginner() const
if( m_pPlayerState->m_PlayerNumber == PLAYER_INVALID ) if( m_pPlayerState->m_PlayerNumber == PLAYER_INVALID )
return false; return false;
Steps *pSteps = GAMESTATE->m_pCurSteps[ m_pPlayerState->m_PlayerNumber ]; 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 ) void Player::SetJudgment( TapNoteScore tns, bool bEarly )
+2 -2
View File
@@ -158,7 +158,7 @@ Grade PlayerStageStats::GetGrade() const
bool bIsBeginner = false; bool bIsBeginner = false;
if( m_vpPlayedSteps.size() && !GAMESTATE->IsCourseMode() ) if( m_vpPlayedSteps.size() && !GAMESTATE->IsCourseMode() )
bIsBeginner = m_vpPlayedSteps[0]->GetDifficulty() == DIFFICULTY_BEGINNER; bIsBeginner = m_vpPlayedSteps[0]->GetDifficulty() == Difficulty_Beginner;
FOREACH_TapNoteScore( tns ) FOREACH_TapNoteScore( tns )
{ {
@@ -186,7 +186,7 @@ Grade PlayerStageStats::GetGrade() const
PREFSMAN->m_bMercifulBeginner; PREFSMAN->m_bMercifulBeginner;
FOREACH_CONST( Steps*, m_vpPlayedSteps, s ) FOREACH_CONST( Steps*, m_vpPlayedSteps, s )
{ {
if( (*s)->GetDifficulty() != DIFFICULTY_BEGINNER ) if( (*s)->GetDifficulty() != Difficulty_Beginner )
bMerciful = false; bMerciful = false;
} }
+1 -1
View File
@@ -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 /* MercifulBeginner shouldn't clamp weights in course mode, even if a beginner song
* is in a course, since that makes PlayerStageStats::GetGrade hard. */ * 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 ); ASSERT( m_iPointBonus >= 0 );
+2 -2
View File
@@ -2634,7 +2634,7 @@ static void ChangeDescription( const RString &sNew )
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
/* Don't erase edit descriptions. */ /* Don't erase edit descriptions. */
if( sNew.empty() && pSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( sNew.empty() && pSteps->GetDifficulty() == Difficulty_Edit )
return; return;
pSteps->SetDescription(sNew); pSteps->SetDescription(sNew);
@@ -3248,7 +3248,7 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v
SM_None, SM_None,
ENTER_NEW_DESCRIPTION, ENTER_NEW_DESCRIPTION,
m_pSteps->GetDescription(), m_pSteps->GetDescription(),
(dc == DIFFICULTY_EDIT) ? MAX_EDIT_STEPS_DESCRIPTION_LENGTH : 255, (dc == Difficulty_Edit) ? MAX_EDIT_STEPS_DESCRIPTION_LENGTH : 255,
SongUtil::ValidateCurrentStepsDescription, SongUtil::ValidateCurrentStepsDescription,
ChangeDescription, ChangeDescription,
NULL NULL
+2 -2
View File
@@ -136,7 +136,7 @@ void ScreenEditMenu::MenuRight( const InputEventPlus &input )
static RString GetCopyDescription( const Steps *pSourceSteps ) static RString GetCopyDescription( const Steps *pSourceSteps )
{ {
RString s; RString s;
if( pSourceSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( pSourceSteps->GetDifficulty() == Difficulty_Edit )
s = pSourceSteps->GetDescription(); s = pSourceSteps->GetDescription();
else else
s = DifficultyToLocalizedString( pSourceSteps->GetDifficulty() ); s = DifficultyToLocalizedString( pSourceSteps->GetDifficulty() );
@@ -302,7 +302,7 @@ void ScreenEditMenu::MenuStart( const InputEventPlus &input )
{ {
// Prepare prepare for ScreenEdit // Prepare prepare for ScreenEdit
ASSERT( pSteps ); ASSERT( pSteps );
bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == DIFFICULTY_EDIT); bool bPromptToNameSteps = (action == EditMenuAction_Create && dc == Difficulty_Edit);
if( bPromptToNameSteps ) if( bPromptToNameSteps )
{ {
ScreenTextEntry::TextEntry( ScreenTextEntry::TextEntry(
+4 -4
View File
@@ -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. 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 /* 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. * and save over their default modifiers every time someone got an extra stage.
* Do this before course modifiers are set up. */ * Do this before course modifiers are set up. */
if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() ) if( !GAMESTATE->IsExtraStage() && !GAMESTATE->IsExtraStage2() )
@@ -1170,7 +1170,7 @@ void ScreenGameplay::LoadNextSong()
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi )
{ {
Steps *pSteps = GAMESTATE->m_pCurSteps[ pi->GetStepsAndTrailIndex() ]; 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() ); m_BeginnerHelper.AddPlayer( pi->GetStepsAndTrailIndex(), pi->m_pPlayer->GetNoteData() );
} }
} }
@@ -1262,7 +1262,7 @@ void ScreenGameplay::LoadLights()
m_CabinetLightsNoteData.Init(); m_CabinetLightsNoteData.Init();
ASSERT( GAMESTATE->m_pCurSong ); 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 ) if( pSteps != NULL )
{ {
pSteps->GetNoteData( m_CabinetLightsNoteData ); pSteps->GetNoteData( m_CabinetLightsNoteData );
@@ -1951,7 +1951,7 @@ void ScreenGameplay::SendCrossedMessages()
PlayerNumber pn = PLAYER_INVALID; PlayerNumber pn = PLAYER_INVALID;
FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) 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; pn = pi->m_pn;
break; break;
+5 -5
View File
@@ -490,11 +490,11 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
{ {
if ( GAMESTATE->m_pCurSong == NULL ) 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 m_DifficultyIcon[pn].SetFromSteps( pn, NULL ); //It will blank it out
return; 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].SetPlayer( pn );
m_DifficultyIcon[pn].SetFromDifficulty( m_DC[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] ); Steps * pSteps = SongUtil::GetStepsByDifficulty( GAMESTATE->m_pCurSong, st, m_DC[pn] );
GAMESTATE->m_pCurSteps[pn].Set( pSteps ); 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 ); m_DifficultyMeters[pn].SetFromSteps( pSteps );
else else
m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, DIFFICULTY_BEGINNER ); m_DifficultyMeters[pn].SetFromStepsTypeAndMeterAndDifficulty( StepsType_Invalid, 0, Difficulty_Beginner );
} }
void ScreenNetSelectMusic::MusicChanged() void ScreenNetSelectMusic::MusicChanged()
@@ -535,7 +535,7 @@ void ScreenNetSelectMusic::MusicChanged()
else else
{ {
int i; int i;
Difficulty Target = DIFFICULTY_EASY; Difficulty Target = Difficulty_Easy;
bool dcs[NUM_Difficulty]; bool dcs[NUM_Difficulty];
+6 -6
View File
@@ -979,11 +979,11 @@ bool Song::IsEasy( StepsType st ) const
/* The easy marker indicates which songs a beginner, having selected "beginner", /* 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 * 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. */ * 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 ) if( pBeginnerNotes )
return true; 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 ) if( pEasyNotes && pEasyNotes->GetMeter() == 1 )
return true; return true;
@@ -997,7 +997,7 @@ bool Song::IsTutorial() const
{ {
if( (*s)->m_StepsType == STEPS_TYPE_LIGHTS_CABINET ) if( (*s)->m_StepsType == STEPS_TYPE_LIGHTS_CABINET )
continue; // ignore continue; // ignore
if( (*s)->GetDifficulty() != DIFFICULTY_BEGINNER ) if( (*s)->GetDifficulty() != Difficulty_Beginner )
return false; return false;
} }
@@ -1010,7 +1010,7 @@ bool Song::HasEdits( StepsType st ) const
{ {
Steps* pSteps = m_vpSteps[i]; Steps* pSteps = m_vpSteps[i];
if( pSteps->m_StepsType == st && if( pSteps->m_StepsType == st &&
pSteps->GetDifficulty() == DIFFICULTY_EDIT ) pSteps->GetDifficulty() == Difficulty_Edit )
{ {
return true; return true;
} }
@@ -1273,12 +1273,12 @@ int Song::GetNumStepsLoadedFromProfile( ProfileSlot slot ) const
bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const
{ {
ASSERT( pSteps->GetDifficulty() == DIFFICULTY_EDIT ); ASSERT( pSteps->GetDifficulty() == Difficulty_Edit );
for( unsigned i=0; i<m_vpSteps.size(); i++ ) for( unsigned i=0; i<m_vpSteps.size(); i++ )
{ {
Steps* pOther = m_vpSteps[i]; Steps* pOther = m_vpSteps[i];
if( pOther->GetDifficulty() == DIFFICULTY_EDIT && if( pOther->GetDifficulty() == Difficulty_Edit &&
pOther->m_StepsType == pSteps->m_StepsType && pOther->m_StepsType == pSteps->m_StepsType &&
pOther->GetHash() == pSteps->GetHash() ) pOther->GetHash() == pSteps->GetHash() )
{ {
+8 -8
View File
@@ -428,8 +428,8 @@ RageColor SongManager::GetSongColor( const Song* pSong )
const Steps* pSteps = vpSteps[i]; const Steps* pSteps = vpSteps[i];
switch( pSteps->GetDifficulty() ) switch( pSteps->GetDifficulty() )
{ {
case DIFFICULTY_CHALLENGE: case Difficulty_Challenge:
case DIFFICULTY_EDIT: case Difficulty_Edit:
continue; continue;
} }
@@ -735,11 +735,11 @@ void SongManager::InitAutogenCourses()
// Generate random courses from each group. // Generate random courses from each group.
pCourse = new Course; pCourse = new Course;
CourseUtil::AutogenEndlessFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse ); CourseUtil::AutogenEndlessFromGroup( sGroupName, Difficulty_Medium, *pCourse );
m_pCourses.push_back( pCourse ); m_pCourses.push_back( pCourse );
pCourse = new Course; pCourse = new Course;
CourseUtil::AutogenNonstopFromGroup( sGroupName, DIFFICULTY_MEDIUM, *pCourse ); CourseUtil::AutogenNonstopFromGroup( sGroupName, Difficulty_Medium, *pCourse );
m_pCourses.push_back( pCourse ); m_pCourses.push_back( pCourse );
} }
@@ -747,7 +747,7 @@ void SongManager::InitAutogenCourses()
// Generate "All Songs" endless course. // Generate "All Songs" endless course.
pCourse = new Course; pCourse = new Course;
CourseUtil::AutogenEndlessFromGroup( "", DIFFICULTY_MEDIUM, *pCourse ); CourseUtil::AutogenEndlessFromGroup( "", Difficulty_Medium, *pCourse );
m_pCourses.push_back( pCourse ); m_pCourses.push_back( pCourse );
/* Generate Oni courses from artists. Only create courses if we have at least /* Generate Oni courses from artists. Only create courses if we have at least
@@ -782,7 +782,7 @@ void SongManager::InitAutogenCourses()
sCurArtist.CompareNoCase("Unknown artist") ) sCurArtist.CompareNoCase("Unknown artist") )
{ {
pCourse = new Course; pCourse = new Course;
CourseUtil::AutogenOniFromArtist( sCurArtist, sCurArtistTranslit, aSongs, DIFFICULTY_HARD, *pCourse ); CourseUtil::AutogenOniFromArtist( sCurArtist, sCurArtistTranslit, aSongs, Difficulty_Hard, *pCourse );
m_pCourses.push_back( 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) bool CompareNotesPointersForExtra(const Steps *n1, const Steps *n2)
{ {
/* Equate CHALLENGE to HARD. */ /* Equate CHALLENGE to HARD. */
Difficulty d1 = min(n1->GetDifficulty(), DIFFICULTY_HARD); Difficulty d1 = min(n1->GetDifficulty(), Difficulty_Hard);
Difficulty d2 = min(n2->GetDifficulty(), DIFFICULTY_HARD); Difficulty d2 = min(n2->GetDifficulty(), Difficulty_Hard);
if(d1 < d2) return true; if(d1 < d2) return true;
if(d1 > d2) return false; if(d1 > d2) return false;
+9 -9
View File
@@ -205,7 +205,7 @@ Steps* SongUtil::GetClosestNotes( const Song *pSong, StepsType st, Difficulty dc
{ {
Steps* pSteps = vpSteps[i]; Steps* pSteps = vpSteps[i];
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT && dc != DIFFICULTY_EDIT ) if( pSteps->GetDifficulty() == Difficulty_Edit && dc != Difficulty_Edit )
continue; continue;
if( bIgnoreLocked && UNLOCKMAN->StepsIsLocked(pSong,pSteps) ) if( bIgnoreLocked && UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
continue; continue;
@@ -230,7 +230,7 @@ void SongUtil::AdjustDuplicateSteps( Song *pSong )
{ {
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
{ {
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
continue; continue;
vector<Steps*> vSteps; vector<Steps*> vSteps;
@@ -245,7 +245,7 @@ void SongUtil::AdjustDuplicateSteps( Song *pSong )
CHECKPOINT; CHECKPOINT;
for( unsigned k=1; k<vSteps.size(); k++ ) for( unsigned k=1; k<vSteps.size(); k++ )
{ {
vSteps[k]->SetDifficulty( DIFFICULTY_EDIT ); vSteps[k]->SetDifficulty( Difficulty_Edit );
if( vSteps[k]->GetDescription() == "" ) if( vSteps[k]->GetDescription() == "" )
{ {
/* "Hard Edit" */ /* "Hard Edit" */
@@ -576,28 +576,28 @@ RString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
} }
case SORT_EASY_METER: 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) ) if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() ); return ssprintf("%02d", pSteps->GetMeter() );
return SORT_NOT_AVAILABLE.GetValue(); return SORT_NOT_AVAILABLE.GetValue();
} }
case SORT_MEDIUM_METER: 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) ) if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() ); return ssprintf("%02d", pSteps->GetMeter() );
return SORT_NOT_AVAILABLE.GetValue(); return SORT_NOT_AVAILABLE.GetValue();
} }
case SORT_HARD_METER: 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) ) if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() ); return ssprintf("%02d", pSteps->GetMeter() );
return SORT_NOT_AVAILABLE.GetValue(); return SORT_NOT_AVAILABLE.GetValue();
} }
case SORT_CHALLENGE_METER: 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) ) if( pSteps && !UNLOCKMAN->StepsIsLocked(pSong,pSteps) )
return ssprintf("%02d", pSteps->GetMeter() ); return ssprintf("%02d", pSteps->GetMeter() );
return SORT_NOT_AVAILABLE.GetValue(); return SORT_NOT_AVAILABLE.GetValue();
@@ -685,7 +685,7 @@ bool SongUtil::IsEditDescriptionUnique( const Song* pSong, StepsType st, const R
{ {
Steps *pSteps = *s; Steps *pSteps = *s;
if( pSteps->GetDifficulty() != DIFFICULTY_EDIT ) if( pSteps->GetDifficulty() != Difficulty_Edit )
continue; continue;
if( pSteps->m_StepsType != st ) if( pSteps->m_StepsType != st )
continue; continue;
@@ -744,7 +744,7 @@ bool SongUtil::ValidateCurrentEditStepsDescription( const RString &sAnswer, RStr
// Steps name must be unique for this song. // Steps name must be unique for this song.
vector<Steps*> v; vector<Steps*> v;
GetSteps( pSong, v, StepsType_Invalid, DIFFICULTY_EDIT ); GetSteps( pSong, v, StepsType_Invalid, Difficulty_Edit );
FOREACH_CONST( Steps*, v, s ) FOREACH_CONST( Steps*, v, s )
{ {
if( pSteps == *s ) if( pSteps == *s )
+5 -5
View File
@@ -153,10 +153,10 @@ void Steps::TidyUpData()
if( GetDifficulty() == Difficulty_Invalid ) if( GetDifficulty() == Difficulty_Invalid )
{ {
if( GetMeter() == 1 ) SetDifficulty( DIFFICULTY_BEGINNER ); if( GetMeter() == 1 ) SetDifficulty( Difficulty_Beginner );
else if( GetMeter() <= 3 ) SetDifficulty( DIFFICULTY_EASY ); else if( GetMeter() <= 3 ) SetDifficulty( Difficulty_Easy );
else if( GetMeter() <= 6 ) SetDifficulty( DIFFICULTY_MEDIUM ); else if( GetMeter() <= 6 ) SetDifficulty( Difficulty_Medium );
else SetDifficulty( DIFFICULTY_HARD ); else SetDifficulty( Difficulty_Hard );
} }
if( GetMeter() < 1) // meter is invalid if( GetMeter() < 1) // meter is invalid
@@ -359,7 +359,7 @@ void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription )
DeAutogen(); DeAutogen();
m_Difficulty = dc; m_Difficulty = dc;
m_sDescription = sDescription; m_sDescription = sDescription;
if( GetDifficulty() == DIFFICULTY_EDIT ) if( GetDifficulty() == Difficulty_Edit )
MakeValidEditDescription( m_sDescription ); MakeValidEditDescription( m_sDescription );
} }
+2 -2
View File
@@ -31,7 +31,7 @@ public:
bool IsAutogen() const { return parent != NULL; } // Was created by autogen? bool IsAutogen() const { return parent != NULL; } // Was created by autogen?
// Use a special value of difficulty // 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 IsAPlayerEdit() const { return IsAnEdit() && GetLoadedFromProfileSlot() < ProfileSlot_Machine; }
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_Invalid; } bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_Invalid; }
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
@@ -87,7 +87,7 @@ private:
ProfileSlot m_LoadedFromProfile; // ProfileSlot_Invalid if wasn't loaded from a profile 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. */ /* 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 RString m_sDescription; // Step author, edit name, or something meaningful
Difficulty m_Difficulty; // difficulty classification Difficulty m_Difficulty; // difficulty classification
int m_iMeter; // difficulty rating from MIN_METER to MAX_METER int m_iMeter; // difficulty rating from MIN_METER to MAX_METER
+5 -5
View File
@@ -199,7 +199,7 @@ void StepsID::FromSteps( const Steps *p )
{ {
st = p->m_StepsType; st = p->m_StepsType;
dc = p->GetDifficulty(); dc = p->GetDifficulty();
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
sDescription = p->GetDescription(); sDescription = p->GetDescription();
uHash = p->GetHash(); uHash = p->GetHash();
@@ -240,7 +240,7 @@ Steps *StepsID::ToSteps( const Song *p, bool bAllowNull, bool bUseCache ) const
} }
Steps *ret = NULL; Steps *ret = NULL;
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
ret = SongUtil::GetOneSteps( p, st, dc, -1, -1, sDescription, uHash, true ); 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( "StepsType", GameManager::StepsTypeToString(st) );
pNode->AppendAttr( "Difficulty", DifficultyToString(dc) ); pNode->AppendAttr( "Difficulty", DifficultyToString(dc) );
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
pNode->AppendAttr( "Description", sDescription ); pNode->AppendAttr( "Description", sDescription );
pNode->AppendAttr( "Hash", uHash ); pNode->AppendAttr( "Hash", uHash );
@@ -291,7 +291,7 @@ void StepsID::LoadFromNode( const XNode* pNode )
pNode->GetAttrValue("Difficulty", sTemp); pNode->GetAttrValue("Difficulty", sTemp);
dc = StringToDifficulty( sTemp ); dc = StringToDifficulty( sTemp );
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
pNode->GetAttrValue("Description", sDescription); pNode->GetAttrValue("Description", sDescription);
pNode->GetAttrValue("Hash", uHash); pNode->GetAttrValue("Hash", uHash);
@@ -307,7 +307,7 @@ RString StepsID::ToString() const
{ {
RString s = GameManager::StepsTypeToString(st); RString s = GameManager::StepsTypeToString(st);
s += " " + DifficultyToString(dc); s += " " + DifficultyToString(dc);
if( dc == DIFFICULTY_EDIT ) if( dc == Difficulty_Edit )
{ {
s += " " + sDescription; s += " " + sDescription;
s += ssprintf(" %u", uHash ); s += ssprintf(" %u", uHash );
+3 -3
View File
@@ -327,7 +327,7 @@ UnlockEntryStatus UnlockEntry::GetUnlockEntryStatus() const
m_pSong, m_pSong,
vp, vp,
StepsType_Invalid, StepsType_Invalid,
DIFFICULTY_HARD Difficulty_Hard
); );
FOREACH_CONST( Steps*, vp, s ) FOREACH_CONST( Steps*, vp, s )
if( PROFILEMAN->GetMachineProfile()->HasPassedSteps( m_pSong, *s ) ) if( PROFILEMAN->GetMachineProfile()->HasPassedSteps( m_pSong, *s ) )
@@ -431,11 +431,11 @@ void UnlockManager::Load()
FOREACH_CONST( Song*, SONGMAN->GetAllSongs(), s ) FOREACH_CONST( Song*, SONGMAN->GetAllSongs(), s )
{ {
// If no hard steps to play to unlock, skip // 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; continue;
// If no challenge steps to unlock, skip // 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; continue;
if( SONGMAN->WasLoadedFromAdditionalSongs(*s) ) if( SONGMAN->WasLoadedFromAdditionalSongs(*s) )