name cleanup: "StepsType nt" -> "StepsType st"

This commit is contained in:
Chris Danford
2004-05-24 03:32:56 +00:00
parent 1d532df9ef
commit 99a02deffe
14 changed files with 139 additions and 139 deletions
+27 -26
View File
@@ -29,6 +29,7 @@
#include "arch/arch.h"
#include "ThemeManager.h"
#include "ProfileManager.h"
#include "Foreach.h"
/* Amount to increase meter ranges to make them difficult: */
const int COURSE_DIFFICULTY_METER_CHANGE[NUM_COURSE_DIFFICULTIES] = { -2, 0, 2 };
@@ -449,7 +450,7 @@ CString Course::GetAutogenDifficultySuffix( Difficulty diff ) const
* play that song, even if we're on difficult and harder notes don't exist. (The
* exception is a static song entry with a meter range, but that's not very useful.)
*/
bool Course::HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const
bool Course::HasCourseDifficulty( StepsType st, CourseDifficulty cd ) const
{
/* Check to see if any songs would change if difficult. */
@@ -457,19 +458,19 @@ bool Course::HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const
if( cd == COURSE_DIFFICULTY_REGULAR )
return true;
Trail *Regular = GetTrail( nt, COURSE_DIFFICULTY_REGULAR );
Trail *Other = GetTrail( nt, cd );
Trail *Regular = GetTrail( st, COURSE_DIFFICULTY_REGULAR );
Trail *Other = GetTrail( st, cd );
return Regular != Other;
}
bool Course::IsPlayableIn( StepsType nt ) const
bool Course::IsPlayableIn( StepsType st ) const
{
Trail* pTrail = GetTrail( nt, COURSE_DIFFICULTY_REGULAR );
Trail* pTrail = GetTrail( st, COURSE_DIFFICULTY_REGULAR );
return !pTrail->m_vEntries.empty();
}
static vector<Song*> GetFilteredBestSongs( StepsType nt )
static vector<Song*> GetFilteredBestSongs( StepsType st )
{
const vector<Song*> &vSongsByMostPlayed = SONGMAN->GetBestSongs();
vector<Song*> ret;
@@ -483,16 +484,16 @@ static vector<Song*> GetFilteredBestSongs( StepsType nt )
continue;
bool FoundMedium = false, FoundHard = false;
for( unsigned j=0; j < pSong->m_apNotes.size(); j++ ) // for each of the Song's Steps
FOREACH( Steps*, pSong->m_apNotes, pSteps )
{
if( pSong->m_apNotes[j]->m_StepsType != nt )
if( (*pSteps)->m_StepsType != st )
continue;
if( !PREFSMAN->m_bAutogenSteps && pSong->m_apNotes[j]->IsAutogen() )
if( !PREFSMAN->m_bAutogenSteps && (*pSteps)->IsAutogen() )
continue;
if( pSong->m_apNotes[j]->GetDifficulty() == DIFFICULTY_MEDIUM )
if( (*pSteps)->GetDifficulty() == DIFFICULTY_MEDIUM )
FoundMedium = true;
else if( pSong->m_apNotes[j]->GetDifficulty() == DIFFICULTY_HARD )
else if( (*pSteps)->GetDifficulty() == DIFFICULTY_HARD )
FoundHard = true;
if( FoundMedium && FoundHard )
@@ -510,12 +511,12 @@ static vector<Song*> GetFilteredBestSongs( StepsType nt )
/* This is called by many simple functions, like Course::GetTotalSeconds, and may
* be called on all songs to sort. It can take time to execute, so we cache the
* results. */
Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
Trail* Course::GetTrail( StepsType st, CourseDifficulty cd ) const
{
//
// Look in the Trail cache
//
const TrailParams params( nt, cd );
const TrailParams params( st, cd );
TrailCache::iterator it = m_TrailCache.find( params );
if( it != m_TrailCache.end() )
{
@@ -551,7 +552,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
int CurSong = 0; /* Current offset into AllSongsShuffled */
Trail trail;
trail.m_StepsType = nt;
trail.m_StepsType = st;
trail.m_CourseDifficulty = cd;
for( unsigned i=0; i<entries.size(); i++ )
@@ -576,11 +577,11 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
if( pSong )
{
if( e.difficulty != DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty );
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
else if( e.low_meter != -1 && e.high_meter != -1 )
pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter );
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( nt, DIFFICULTY_MEDIUM );
pNotes = pSong->GetStepsByDifficulty( st, DIFFICULTY_MEDIUM );
}
break;
case COURSE_ENTRY_RANDOM:
@@ -607,9 +608,9 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
continue; /* wrong group */
if( e.difficulty == DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter );
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty );
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
if( pNotes ) // found a match
break; // stop searching
@@ -625,7 +626,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
if( !bMostPlayedSet )
{
bMostPlayedSet = true;
vSongsByMostPlayed = GetFilteredBestSongs( nt );
vSongsByMostPlayed = GetFilteredBestSongs( st );
}
if( e.players_index >= (int)vSongsByMostPlayed.size() )
@@ -644,12 +645,12 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
}
if( e.difficulty == DIFFICULTY_INVALID )
pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter );
pNotes = pSong->GetStepsByMeter( st, low_meter, high_meter );
else
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty );
pNotes = pSong->GetStepsByDifficulty( st, e.difficulty );
if( pNotes == NULL )
pNotes = pSong->GetClosestNotes( nt, DIFFICULTY_MEDIUM );
pNotes = pSong->GetClosestNotes( st, DIFFICULTY_MEDIUM );
}
break;
default:
@@ -670,7 +671,7 @@ Trail* Course::GetTrail( StepsType nt, CourseDifficulty cd ) const
dc = clamp( dc, DIFFICULTY_BEGINNER, DIFFICULTY_CHALLENGE );
if( dc != original_dc )
{
Steps* pNewNotes = pSong->GetStepsByDifficulty( nt, dc );
Steps* pNewNotes = pSong->GetStepsByDifficulty( st, dc );
if( pNewNotes )
pNotes = pNewNotes;
}
@@ -870,11 +871,11 @@ bool Course::IsRanking() const
return false;
}
float Course::GetMeter( StepsType nt, CourseDifficulty cd ) const
float Course::GetMeter( StepsType st, CourseDifficulty cd ) const
{
/* If we have a manually-entered meter for this difficulty, use it. */
if( m_iCustomMeter[cd] != -1 )
return (float)m_iCustomMeter[cd];
return roundf( GetTrail(nt,cd)->GetAverageMeter() );
return roundf( GetTrail(st,cd)->GetAverageMeter() );
}
+4 -4
View File
@@ -100,14 +100,14 @@ public:
// Dereferences course_entries and returns only the playable Songs and Steps
Trail* GetTrail( StepsType nt, CourseDifficulty cd ) const;
float GetMeter( StepsType nt, CourseDifficulty cd ) const;
Trail* GetTrail( StepsType st, CourseDifficulty cd ) const;
float GetMeter( StepsType st, CourseDifficulty cd ) const;
bool HasMods() const;
bool AllSongsAreFixed() const;
int GetEstimatedNumStages() const { return m_entries.size(); }
bool HasCourseDifficulty( StepsType nt, CourseDifficulty cd ) const;
bool IsPlayableIn( StepsType nt ) const;
bool HasCourseDifficulty( StepsType st, CourseDifficulty cd ) const;
bool IsPlayableIn( StepsType st ) const;
bool CourseHasBestOrWorst() const;
RageColor GetColor() const;
bool GetTotalSeconds( StepsType st, float& fSecondsOut ) const;
+10 -10
View File
@@ -2360,10 +2360,10 @@ void GameManager::GetStylesForGame( Game game, vector<Style>& aStylesAddTo, bool
}
}
Style GameManager::GetEditorStyleForNotesType( StepsType nt )
Style GameManager::GetEditorStyleForNotesType( StepsType st )
{
for( int s=0; s<NUM_STYLES; s++ )
if( g_StyleDefs[s].m_StepsType == nt && g_StyleDefs[s].m_bUsedForEdit )
if( g_StyleDefs[s].m_StepsType == st && g_StyleDefs[s].m_bUsedForEdit )
return (Style)s;
ASSERT(0); // this style doesn't have a StyleDef that can be used with the editor!
@@ -2412,16 +2412,16 @@ bool GameManager::IsGameEnabled( Game game )
return find( aGames.begin(), aGames.end(), game ) != aGames.end();
}
int GameManager::NotesTypeToNumTracks( StepsType nt )
int GameManager::NotesTypeToNumTracks( StepsType st )
{
if(nt >= NUM_STEPS_TYPES)
if( st >= NUM_STEPS_TYPES )
{
// invalid StepsType
ASSERT(0);
return -1;
}
return NotesTypes[nt].NumTracks;
return NotesTypes[st].NumTracks;
}
StepsType GameManager::StringToNotesType( CString sNotesType )
@@ -2445,21 +2445,21 @@ StepsType GameManager::StringToNotesType( CString sNotesType )
return STEPS_TYPE_DANCE_SINGLE;
}
CString GameManager::NotesTypeToString( StepsType nt )
CString GameManager::NotesTypeToString( StepsType st )
{
if(nt >= NUM_STEPS_TYPES)
if( st >= NUM_STEPS_TYPES )
{
// invalid StepsType
ASSERT(0);
return "";
}
return NotesTypes[nt].name;
return NotesTypes[st].name;
}
CString GameManager::NotesTypeToThemedString( StepsType nt )
CString GameManager::NotesTypeToThemedString( StepsType st )
{
CString s = NotesTypeToString(nt);
CString s = NotesTypeToString( st );
if( THEME->HasMetric( "StepsType", s ) )
return THEME->GetMetric( "StepsType", s );
else
+4 -4
View File
@@ -29,15 +29,15 @@ public:
void GetStylesForGame( Game game, vector<Style>& aStylesAddTo, bool editor=false );
void GetNotesTypesForGame( Game game, vector<StepsType>& aNotesTypeAddTo );
Style GetEditorStyleForNotesType( StepsType nt );
Style GetEditorStyleForNotesType( StepsType st );
void GetEnabledGames( vector<Game>& aGamesOut );
bool IsGameEnabled( Game game );
static int NotesTypeToNumTracks( StepsType nt );
static int NotesTypeToNumTracks( StepsType st );
static StepsType StringToNotesType( CString sNotesType );
static CString NotesTypeToString( StepsType nt );
static CString NotesTypeToThemedString( StepsType nt );
static CString NotesTypeToString( StepsType st );
static CString NotesTypeToThemedString( StepsType st );
static Game StringToGameType( CString sGameType );
Style GameAndStringToStyle( Game game, CString sStyle );
static CString StyleToThemedString( Style s );
+9 -11
View File
@@ -145,7 +145,7 @@ void GameState::Reset()
m_iRoundSeed = rand();
m_pCurSong = NULL;
for( p=0; p<NUM_PLAYERS; p++ )
FOREACH_PlayerNumber( p )
m_pCurNotes[p] = NULL;
m_pCurCourse = NULL;
@@ -1338,7 +1338,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
CHECKPOINT;
unsigned i, j;
StepsType nt = this->GetCurrentStyleDef()->m_StepsType;
StepsType st = this->GetCurrentStyleDef()->m_StepsType;
//
// Find unique Song and Steps combinations that were played.
@@ -1436,10 +1436,9 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
// Find Machine Category Records
for( i=0; i<NUM_RANKING_CATEGORIES; i++ )
FOREACH_RankingCategory( rc )
{
RankingCategory rc = (RankingCategory)i;
HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCategoryHighScoreList( nt, rc );
HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCategoryHighScoreList( st, rc );
for( unsigned j=0; j<hsl.vHighScores.size(); j++ )
{
HighScore &hs = hsl.vHighScores[j];
@@ -1458,12 +1457,11 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
}
// Find Personal Category Records
for( i=0; i<NUM_RANKING_CATEGORIES; i++ )
FOREACH_RankingCategory( rc )
{
RankingCategory rc = (RankingCategory)i;
if( pProf )
{
HighScoreList &hsl = pProf->GetCategoryHighScoreList( nt, rc );
HighScoreList &hsl = pProf->GetCategoryHighScoreList( st, rc );
for( unsigned j=0; j<hsl.vHighScores.size(); j++ )
{
HighScore &hs = hsl.vHighScores[j];
@@ -1491,7 +1489,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
case PLAY_MODE_ENDLESS:
{
CHECKPOINT;
StepsType nt = this->GetCurrentStyleDef()->m_StepsType;
StepsType st = this->GetCurrentStyleDef()->m_StepsType;
Course* pCourse = this->m_pCurCourse;
ASSERT( pCourse );
CourseDifficulty cd = this->m_PreferredCourseDifficulty[pn];
@@ -1499,7 +1497,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
// Find Machine Records
{
Profile* pProfile = PROFILEMAN->GetMachineProfile();
Trail *pTrail = pCourse->GetTrail( nt, cd );
Trail *pTrail = pCourse->GetTrail( st, cd );
HighScoreList &hsl = pProfile->GetCourseHighScoreList( pCourse, pTrail );
for( unsigned i=0; i<hsl.vHighScores.size(); i++ )
{
@@ -1524,7 +1522,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
// Find Personal Records
if( PROFILEMAN->IsUsingProfile( pn ) )
{
Trail *pTrail = pCourse->GetTrail( nt, cd );
Trail *pTrail = pCourse->GetTrail( st, cd );
HighScoreList &hsl = pProf->GetCourseHighScoreList( pCourse, pTrail );
for( unsigned i=0; i<hsl.vHighScores.size(); i++ )
{
+1
View File
@@ -26,6 +26,7 @@
class Song;
class Steps;
class Course;
class Trail;
class GameDef;
class StyleDef;
class NoteFieldPositioning;
+2 -2
View File
@@ -83,8 +83,8 @@ public:
//
// Category stats
//
void AddCategoryScore( StepsType nt, RankingCategory rc, PlayerNumber pn, HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementCategoryPlayCount( StepsType nt, RankingCategory rc, PlayerNumber pn );
void AddCategoryScore( StepsType st, RankingCategory rc, PlayerNumber pn, HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut );
void IncrementCategoryPlayCount( StepsType st, RankingCategory rc, PlayerNumber pn );
// void ReadSM300NoteScores();
+5 -5
View File
@@ -96,7 +96,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
return;
Song* pSong = m_Selector.GetSelectedSong();
StepsType nt = m_Selector.GetSelectedNotesType();
StepsType st = m_Selector.GetSelectedNotesType();
Difficulty dc = m_Selector.GetSelectedDifficulty();
Steps* pNotes = m_Selector.GetSelectedNotes();
// StepsType soureNT = m_Selector.GetSelectedSourceNotesType();
@@ -105,7 +105,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
EditMenu::Action action = m_Selector.GetSelectedAction();
GAMESTATE->m_pCurSong = pSong;
GAMESTATE->m_CurStyle = GAMEMAN->GetEditorStyleForNotesType( nt );
GAMESTATE->m_CurStyle = GAMEMAN->GetEditorStyleForNotesType( st );
GAMESTATE->m_pCurNotes[PLAYER_1] = pNotes;
//
@@ -139,7 +139,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// Yuck. Doing the memory allocation doesn't seem right since
// Song allocates all of the other Steps.
Steps* pNewNotes = new Steps;
pNewNotes->CopyFrom( pSourceNotes, nt );
pNewNotes->CopyFrom( pSourceNotes, st );
pNewNotes->SetDifficulty( dc );
pSong->AddNotes( pNewNotes );
@@ -156,7 +156,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// Yuck. Doing the memory allocation doesn't seem right since
// Song allocates all of the other Steps.
Steps* pNewNotes = new Steps;
pNewNotes->AutogenFrom( pSourceNotes, nt );
pNewNotes->AutogenFrom( pSourceNotes, st );
pNewNotes->DeAutogen();
pNewNotes->SetDifficulty( dc ); // override difficulty with the user's choice
pSong->AddNotes( pNewNotes );
@@ -173,7 +173,7 @@ void ScreenEditMenu::MenuStart( PlayerNumber pn )
// Yuck. Doing the memory allocation doesn't seem right since
// Song allocates all of the other Steps.
Steps* pNewNotes = new Steps;
pNewNotes->CreateBlank( nt );
pNewNotes->CreateBlank( st );
pNewNotes->SetDifficulty( dc );
pNewNotes->SetMeter( 1 );
pSong->AddNotes( pNewNotes );
+3 -3
View File
@@ -899,7 +899,7 @@ void ScreenEvaluation::CommitScores(
hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : "";
hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
StepsType nt = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
switch( m_Type )
{
@@ -924,10 +924,10 @@ void ScreenEvaluation::CommitScores(
float fAverageMeter = stageStats.iMeter[p] / (float)PREFSMAN->m_iNumArcadeStages;
rcOut[p] = AverageMeterToRankingCategory( fAverageMeter );
PROFILEMAN->AddCategoryScore( nt, rcOut[p], p, hs, iPersonalHighScoreIndexOut[p], iMachineHighScoreIndexOut[p] );
PROFILEMAN->AddCategoryScore( st, rcOut[p], p, hs, iPersonalHighScoreIndexOut[p], iMachineHighScoreIndexOut[p] );
// TRICKY: Increment play count here, and not on ScreenGameplay like the others.
PROFILEMAN->IncrementCategoryPlayCount( nt, rcOut[p], p );
PROFILEMAN->IncrementCategoryPlayCount( st, rcOut[p], p );
}
break;
+24 -24
View File
@@ -144,39 +144,39 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE;
GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS;
StageStats st;
StageStats ss;
for( int z = 0; z < 3; ++z )
{
st.pSong = SONGMAN->GetRandomSong();
st.iPossibleDancePoints[PLAYER_1] = 100;
st.iActualDancePoints[PLAYER_1] = 100;
st.iScore[PLAYER_1] = 100;
st.iPossibleDancePoints[PLAYER_2] = 100;
st.iActualDancePoints[PLAYER_2] = 100;
st.iScore[PLAYER_2] = 100;
ASSERT( st.pSong );
ASSERT( st.pSong->m_apNotes.size() );
for( int p = 0; p < NUM_PLAYERS; ++p )
ss.pSong = SONGMAN->GetRandomSong();
ss.iPossibleDancePoints[PLAYER_1] = 100;
ss.iActualDancePoints[PLAYER_1] = 100;
ss.iScore[PLAYER_1] = 100;
ss.iPossibleDancePoints[PLAYER_2] = 100;
ss.iActualDancePoints[PLAYER_2] = 100;
ss.iScore[PLAYER_2] = 100;
ASSERT( ss.pSong );
ASSERT( ss.pSong->m_apNotes.size() );
FOREACH_PlayerNumber( p )
{
GAMESTATE->m_pCurNotes[p] = st.pSteps[p] = st.pSong->m_apNotes[0];
st.iPossibleDancePoints[p] = 1000;
st.iActualDancePoints[p] = 985;
GAMESTATE->m_pCurNotes[p] = ss.pSteps[p] = ss.pSong->m_apNotes[0];
ss.iPossibleDancePoints[p] = 1000;
ss.iActualDancePoints[p] = 985;
HighScore hs;
hs.grade = GRADE_TIER_3;
hs.fPercentDP = st.GetPercentDancePoints((PlayerNumber)p);
hs.iScore = st.iScore[p];
StepsType nt = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
hs.fPercentDP = ss.GetPercentDancePoints((PlayerNumber)p);
hs.iScore = ss.iScore[p];
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
int a, b;
PROFILEMAN->AddStepsScore( st.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( st.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( st.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( st.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( st.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddCategoryScore( nt, RANKING_A, (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( ss.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( ss.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( ss.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( ss.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddStepsScore( ss.pSong, GAMESTATE->m_pCurNotes[p], (PlayerNumber)p, hs, a, b );
PROFILEMAN->AddCategoryScore( st, RANKING_A, p, hs, a, b );
}
g_vPlayedStageStats.push_back( st );
g_vPlayedStageStats.push_back( ss );
}
}
+3 -3
View File
@@ -282,10 +282,10 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
split( STEPS_TYPES_TO_HIDE, ",", asStepsTypesToHide, true );
for( unsigned i=0; i<asStepsTypesToHide.size(); i++ )
{
StepsType nt = GameManager::StringToNotesType(asStepsTypesToHide[i]);
if( nt != STEPS_TYPE_INVALID )
StepsType st = GameManager::StringToNotesType(asStepsTypesToHide[i]);
if( st != STEPS_TYPE_INVALID )
{
const vector<StepsType>::iterator iter = find( aStepsTypesToShow.begin(), aStepsTypesToShow.end(), nt );
const vector<StepsType>::iterator iter = find( aStepsTypesToShow.begin(), aStepsTypesToShow.end(), st );
if( iter != aStepsTypesToShow.end() )
aStepsTypesToShow.erase( iter );
}
+37 -37
View File
@@ -876,10 +876,10 @@ void Song::ReCalculateRadarValuesAndLastBeat()
}
}
void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, const CString &sDescription, bool bIncludeAutoGen, int Max ) const
void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType st, Difficulty dc, int iMeterLow, int iMeterHigh, const CString &sDescription, bool bIncludeAutoGen, int Max ) const
{
/* Ignore m_bAutogenSteps for STEPS_TYPE_LIGHTS_CABINET. */
if( nt != STEPS_TYPE_LIGHTS_CABINET && !PREFSMAN->m_bAutogenSteps )
if( st != STEPS_TYPE_LIGHTS_CABINET && !PREFSMAN->m_bAutogenSteps )
bIncludeAutoGen = false;
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
@@ -889,7 +889,7 @@ void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, in
Steps* pSteps = m_apNotes[i];
if( nt != STEPS_TYPE_INVALID && pSteps->m_StepsType != nt )
if( st != STEPS_TYPE_INVALID && pSteps->m_StepsType != st )
continue;
if( dc != DIFFICULTY_INVALID && dc != pSteps->GetDifficulty() )
continue;
@@ -909,30 +909,30 @@ void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, in
}
}
Steps* Song::GetStepsByDifficulty( StepsType nt, Difficulty dc, bool bIncludeAutoGen ) const
Steps* Song::GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen ) const
{
vector<Steps*> vNotes;
GetSteps( vNotes, nt, dc, -1, -1, "", bIncludeAutoGen, 1 );
GetSteps( vNotes, st, dc, -1, -1, "", bIncludeAutoGen, 1 );
if( vNotes.size() == 0 )
return NULL;
else
return vNotes[0];
}
Steps* Song::GetStepsByMeter( StepsType nt, int iMeterLow, int iMeterHigh ) const
Steps* Song::GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const
{
vector<Steps*> vNotes;
GetSteps( vNotes, nt, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", true, 1 );
GetSteps( vNotes, st, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", true, 1 );
if( vNotes.size() == 0 )
return NULL;
else
return vNotes[0];
}
Steps* Song::GetStepsByDescription( StepsType nt, CString sDescription ) const
Steps* Song::GetStepsByDescription( StepsType st, CString sDescription ) const
{
vector<Steps*> vNotes;
GetSteps( vNotes, nt, DIFFICULTY_INVALID, -1, -1, sDescription );
GetSteps( vNotes, st, DIFFICULTY_INVALID, -1, -1, sDescription );
if( vNotes.size() == 0 )
return NULL;
else
@@ -940,31 +940,31 @@ Steps* Song::GetStepsByDescription( StepsType nt, CString sDescription ) const
}
Steps* Song::GetClosestNotes( StepsType nt, Difficulty dc ) const
Steps* Song::GetClosestNotes( StepsType st, Difficulty dc ) const
{
Difficulty newDC = dc;
Steps* pNotes;
pNotes = GetStepsByDifficulty( nt, newDC );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
newDC = (Difficulty)(dc-1);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( nt, newDC );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
newDC = (Difficulty)(dc+1);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( nt, newDC );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
newDC = (Difficulty)(dc-2);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( nt, newDC );
pNotes = GetStepsByDifficulty( st, newDC );
if( pNotes )
return pNotes;
newDC = (Difficulty)(dc+2);
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
pNotes = GetStepsByDifficulty( nt, newDC );
pNotes = GetStepsByDifficulty( st, newDC );
return pNotes;
}
@@ -974,17 +974,17 @@ bool Song::SongCompleteForStyle( const StyleDef *st ) const
return SongHasNotesType( st->m_StepsType );
}
bool Song::SongHasNotesType( StepsType nt ) const
bool Song::SongHasNotesType( StepsType st ) const
{
vector<Steps*> add;
GetSteps( add, nt, DIFFICULTY_INVALID, -1, -1, "", true, 1 );
GetSteps( add, st, DIFFICULTY_INVALID, -1, -1, "", true, 1 );
return !add.empty();
}
bool Song::SongHasNotesTypeAndDifficulty( StepsType nt, Difficulty dc ) const
bool Song::SongHasNotesTypeAndDifficulty( StepsType st, Difficulty dc ) const
{
vector<Steps*> add;
GetSteps( add, nt, dc, -1, -1, "", true, 1 );
GetSteps( add, st, dc, -1, -1, "", true, 1 );
return !add.empty();
}
@@ -1062,39 +1062,39 @@ void Song::AddAutoGenNotes()
if( m_apNotes[i]->IsAutogen() )
continue;
StepsType nt = m_apNotes[i]->m_StepsType;
HasNotes[nt] = true;
StepsType st = m_apNotes[i]->m_StepsType;
HasNotes[st] = true;
}
for( StepsType ntMissing=(StepsType)0; ntMissing<NUM_STEPS_TYPES; ntMissing=(StepsType)(ntMissing+1) )
FOREACH_StepsType( stMissing )
{
if( HasNotes[ntMissing] )
if( HasNotes[stMissing] )
continue;
// missing Steps of this type
int iNumTracksOfMissing = GAMEMAN->NotesTypeToNumTracks(ntMissing);
int iNumTracksOfMissing = GAMEMAN->NotesTypeToNumTracks(stMissing);
// look for closest match
StepsType ntBestMatch = (StepsType)-1;
StepsType stBestMatch = (StepsType)-1;
int iBestTrackDifference = 10000; // inf
for( StepsType nt=(StepsType)0; nt<NUM_STEPS_TYPES; nt=(StepsType)(nt+1) )
FOREACH_StepsType( st )
{
if( !HasNotes[nt] )
if( !HasNotes[st] )
continue;
/* has (non-autogen) Steps of this type */
const int iNumTracks = GAMEMAN->NotesTypeToNumTracks(nt);
const int iNumTracks = GAMEMAN->NotesTypeToNumTracks(st);
const int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing);
if( iTrackDifference < iBestTrackDifference )
{
ntBestMatch = nt;
stBestMatch = st;
iBestTrackDifference = iTrackDifference;
}
}
if( ntBestMatch != -1 )
AutoGen( ntMissing, ntBestMatch );
if( stBestMatch != -1 )
AutoGen( stMissing, stBestMatch );
}
}
@@ -1126,9 +1126,9 @@ void Song::RemoveAutoGenNotes()
}
}
bool Song::IsEasy( StepsType nt ) const
bool Song::IsEasy( StepsType st ) const
{
const Steps* pHardNotes = GetStepsByDifficulty( nt, DIFFICULTY_HARD );
const Steps* pHardNotes = GetStepsByDifficulty( st, DIFFICULTY_HARD );
// HACK: Looks bizarre to see the easy mark by Legend of MAX.
if( pHardNotes && pHardNotes->GetMeter() > 9 )
@@ -1137,23 +1137,23 @@ bool Song::IsEasy( StepsType nt ) 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 = GetStepsByDifficulty( nt, DIFFICULTY_BEGINNER );
const Steps* pBeginnerNotes = GetStepsByDifficulty( st, DIFFICULTY_BEGINNER );
if( pBeginnerNotes )
return true;
const Steps* pEasyNotes = GetStepsByDifficulty( nt, DIFFICULTY_EASY );
const Steps* pEasyNotes = GetStepsByDifficulty( st, DIFFICULTY_EASY );
if( pEasyNotes && pEasyNotes->GetMeter() == 1 )
return true;
return false;
}
bool Song::HasEdits( StepsType nt ) const
bool Song::HasEdits( StepsType st ) const
{
for( unsigned i=0; i<m_apNotes.size(); i++ )
{
Steps* pSteps = m_apNotes[i];
if( pSteps->m_StepsType == nt &&
if( pSteps->m_StepsType == st &&
pSteps->GetDifficulty() == DIFFICULTY_EDIT )
{
return true;
+1 -1
View File
@@ -387,7 +387,7 @@ RageColor SongManager::GetSongColor( const Song* pSong )
* XXX: Ack. This means this function can only be called when we have a style
* set up, which is too restrictive. How to handle this?
*/
// const StepsType nt = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
// const StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
for( unsigned i=0; i<pSong->m_apNotes.size(); i++ )
{
const Steps* pNotes = pSong->m_apNotes[i];
+9 -9
View File
@@ -183,16 +183,16 @@ public:
vector<Steps*> m_apNotes;
bool SongCompleteForStyle( const StyleDef *st ) const;
bool SongHasNotesType( StepsType nt ) const;
bool SongHasNotesTypeAndDifficulty( StepsType nt, Difficulty dc ) const;
bool SongHasNotesType( StepsType st ) const;
bool SongHasNotesTypeAndDifficulty( StepsType st, Difficulty dc ) const;
const vector<Steps*>& GetAllSteps() const { return m_apNotes; }
void GetSteps( vector<Steps*>& arrayAddTo, StepsType nt = STEPS_TYPE_INVALID, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, const CString &sDescription = "", bool bIncludeAutoGen = true, int Max = -1 ) const;
Steps* GetStepsByDifficulty( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
Steps* GetStepsByMeter( StepsType nt, int iMeterLow, int iMeterHigh ) const;
Steps* GetStepsByDescription( StepsType nt, CString sDescription ) const;
Steps* GetClosestNotes( StepsType nt, Difficulty dc ) const;
bool IsEasy( StepsType nt ) const;
bool HasEdits( StepsType nt ) const;
void GetSteps( vector<Steps*>& arrayAddTo, StepsType st = STEPS_TYPE_INVALID, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, const CString &sDescription = "", bool bIncludeAutoGen = true, int Max = -1 ) const;
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;
Steps* GetStepsByMeter( StepsType st, int iMeterLow, int iMeterHigh ) const;
Steps* GetStepsByDescription( StepsType st, CString sDescription ) const;
Steps* GetClosestNotes( StepsType st, Difficulty dc ) const;
bool IsEasy( StepsType st ) const;
bool HasEdits( StepsType st ) const;
SelectionDisplay GetDisplayed() const;
bool NormallyDisplayed() const { return GetDisplayed() == SHOW_ALWAYS; }
bool NeverDisplayed() const { return GetDisplayed() == SHOW_NEVER; }