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