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