stop accessing Song::m_vpSteps directly
This commit is contained in:
@@ -491,8 +491,10 @@ static vector<Song*> GetFilteredBestSongs( StepsType st )
|
|||||||
if( SONGMAN->GetNumStagesForSong(pSong) > 1 )
|
if( SONGMAN->GetNumStagesForSong(pSong) > 1 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const vector<Steps*>& vpSteps = pSong->GetAllSteps();
|
||||||
|
|
||||||
bool FoundMedium = false, FoundHard = false;
|
bool FoundMedium = false, FoundHard = false;
|
||||||
FOREACH( Steps*, pSong->m_vpSteps, pSteps )
|
FOREACH_CONST( Steps*, vpSteps, pSteps )
|
||||||
{
|
{
|
||||||
if( (*pSteps)->m_StepsType != st )
|
if( (*pSteps)->m_StepsType != st )
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ void ScreenEvaluation::Init()
|
|||||||
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
GAMESTATE->m_MasterPlayerNumber = PLAYER_1;
|
||||||
GAMESTATE->m_pCurSong = SONGMAN->GetRandomSong();
|
GAMESTATE->m_pCurSong = SONGMAN->GetRandomSong();
|
||||||
GAMESTATE->m_pCurCourse = SONGMAN->GetRandomCourse();
|
GAMESTATE->m_pCurCourse = SONGMAN->GetRandomCourse();
|
||||||
GAMESTATE->m_pCurSteps[PLAYER_1] = GAMESTATE->m_pCurSong->m_vpSteps[0];
|
GAMESTATE->m_pCurSteps[PLAYER_1] = GAMESTATE->m_pCurSong->GetAllSteps()[0];
|
||||||
GAMESTATE->m_pCurSteps[PLAYER_2] = GAMESTATE->m_pCurSong->m_vpSteps[0];
|
GAMESTATE->m_pCurSteps[PLAYER_2] = GAMESTATE->m_pCurSong->GetAllSteps()[0];
|
||||||
g_CurStageStats.pSteps[PLAYER_1] = GAMESTATE->m_pCurSteps[PLAYER_1];
|
g_CurStageStats.pSteps[PLAYER_1] = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||||
g_CurStageStats.pSteps[PLAYER_2] = GAMESTATE->m_pCurSteps[PLAYER_2];
|
g_CurStageStats.pSteps[PLAYER_2] = GAMESTATE->m_pCurSteps[PLAYER_2];
|
||||||
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2;
|
GAMESTATE->m_PlayerOptions[PLAYER_1].m_fScrollSpeed = 2;
|
||||||
|
|||||||
@@ -155,10 +155,10 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
|
|||||||
ss.iActualDancePoints[PLAYER_2] = 100;
|
ss.iActualDancePoints[PLAYER_2] = 100;
|
||||||
ss.iScore[PLAYER_2] = 100;
|
ss.iScore[PLAYER_2] = 100;
|
||||||
ASSERT( ss.pSong );
|
ASSERT( ss.pSong );
|
||||||
ASSERT( ss.pSong->m_vpSteps.size() );
|
ASSERT( ss.pSong->GetAllSteps().size() );
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
{
|
{
|
||||||
GAMESTATE->m_pCurSteps[p] = ss.pSteps[p] = ss.pSong->m_vpSteps[0];
|
GAMESTATE->m_pCurSteps[p] = ss.pSteps[p] = ss.pSong->GetAllSteps()[0];
|
||||||
ss.iPossibleDancePoints[p] = 1000;
|
ss.iPossibleDancePoints[p] = 1000;
|
||||||
ss.iActualDancePoints[p] = 985;
|
ss.iActualDancePoints[p] = 985;
|
||||||
|
|
||||||
|
|||||||
@@ -391,9 +391,10 @@ RageColor SongManager::GetSongColor( const Song* pSong )
|
|||||||
* set up, which is too restrictive. How to handle this?
|
* set up, which is too restrictive. How to handle this?
|
||||||
*/
|
*/
|
||||||
// const StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
// const StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||||
for( unsigned i=0; i<pSong->m_vpSteps.size(); i++ )
|
const vector<Steps*>& vpSteps = pSong->GetAllSteps();
|
||||||
|
for( unsigned i=0; i<vpSteps.size(); i++ )
|
||||||
{
|
{
|
||||||
const Steps* pSteps = pSong->m_vpSteps[i];
|
const Steps* pSteps = vpSteps[i];
|
||||||
switch( pSteps->GetDifficulty() )
|
switch( pSteps->GetDifficulty() )
|
||||||
{
|
{
|
||||||
case DIFFICULTY_CHALLENGE:
|
case DIFFICULTY_CHALLENGE:
|
||||||
@@ -660,9 +661,10 @@ void SongManager::Cleanup()
|
|||||||
for( unsigned i=0; i<m_pSongs.size(); i++ )
|
for( unsigned i=0; i<m_pSongs.size(); i++ )
|
||||||
{
|
{
|
||||||
Song* pSong = m_pSongs[i];
|
Song* pSong = m_pSongs[i];
|
||||||
for( unsigned n=0; n<pSong->m_vpSteps.size(); n++ )
|
const vector<Steps*>& vpSteps = pSong->GetAllSteps();
|
||||||
|
for( unsigned n=0; n<vpSteps.size(); n++ )
|
||||||
{
|
{
|
||||||
Steps* pSteps = pSong->m_vpSteps[n];
|
Steps* pSteps = vpSteps[n];
|
||||||
pSteps->Compress();
|
pSteps->Compress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1100,8 +1102,9 @@ static bool CheckPointer( const Steps *p )
|
|||||||
const vector<Song*> &songs = SONGMAN->GetAllSongs();
|
const vector<Song*> &songs = SONGMAN->GetAllSongs();
|
||||||
for( unsigned i = 0; i < songs.size(); ++i )
|
for( unsigned i = 0; i < songs.size(); ++i )
|
||||||
{
|
{
|
||||||
for( unsigned j = 0; j < songs.size(); ++j )
|
const vector<Steps*>& vpSteps = songs[i]->GetAllSteps();
|
||||||
if( songs[i]->m_vpSteps[j] == p )
|
for( unsigned j = 0; j < vpSteps.size(); ++j )
|
||||||
|
if( vpSteps[j] == p )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user