some more s/GetSize/size/ and other minor STLisms
This commit is contained in:
@@ -75,7 +75,7 @@ Background::~Background()
|
||||
|
||||
void Background::Unload()
|
||||
{
|
||||
for( int i=0; i<m_BGAnimations.GetSize(); i++ )
|
||||
for( unsigned i=0; i<m_BGAnimations.size(); i++ )
|
||||
delete m_BGAnimations[i];
|
||||
m_BGAnimations.clear();
|
||||
|
||||
@@ -104,7 +104,7 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise
|
||||
|
||||
// Look for BG movies in the song dir
|
||||
GetDirListing( pSong->m_sSongDir+aniseg.m_sBGName, asFiles, false, true );
|
||||
if( asFiles.GetSize() > 0 )
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromMovie( asFiles[0], true, true );
|
||||
@@ -112,7 +112,7 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise
|
||||
}
|
||||
// Look for BGAnims in the song dir
|
||||
GetDirListing( pSong->m_sSongDir+aniseg.m_sBGName, asFiles, true, true );
|
||||
if( asFiles.GetSize() > 0 )
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromAniDir( asFiles[0], bgpath );
|
||||
@@ -121,7 +121,7 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise
|
||||
|
||||
// Look for movies in the RandomMovies dir
|
||||
GetDirListing( RANDOMMOVIES_DIR+aniseg.m_sBGName, asFiles, false, true );
|
||||
if( asFiles.GetSize() > 0 )
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromMovie( asFiles[0], true, false );
|
||||
@@ -130,7 +130,7 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise
|
||||
|
||||
// Look for BGAnims in the BGAnims dir
|
||||
GetDirListing( BG_ANIMS_DIR+aniseg.m_sBGName, asFiles, true, true );
|
||||
if( asFiles.GetSize() > 0 )
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromAniDir( asFiles[0], bgpath );
|
||||
@@ -139,7 +139,7 @@ BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &anise
|
||||
|
||||
// Look for BGAnims in the BGAnims dir
|
||||
GetDirListing( VISUALIZATIONS_DIR+aniseg.m_sBGName, asFiles, false, true );
|
||||
if( asFiles.GetSize() > 0 )
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromVisualization( asFiles[0], bgpath );
|
||||
@@ -189,7 +189,7 @@ void Background::LoadFromSong( Song* pSong )
|
||||
|
||||
// Load the animations used by the song's pre-defined animation plan.
|
||||
// the song has a plan. Use it.
|
||||
for( int i=0; i<pSong->m_BackgroundChanges.GetSize(); i++ )
|
||||
for( unsigned i=0; i<pSong->m_BackgroundChanges.size(); i++ )
|
||||
{
|
||||
const BackgroundChange& aniseg = pSong->m_BackgroundChanges[i];
|
||||
bool bFade = i==0;
|
||||
@@ -200,7 +200,7 @@ void Background::LoadFromSong( Song* pSong )
|
||||
{
|
||||
m_BGAnimations.Add( pTempBGA );
|
||||
// add to the plan
|
||||
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.GetSize()-1, bFade) );
|
||||
m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.size()-1, bFade) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,9 +243,9 @@ void Background::LoadFromSong( Song* pSong )
|
||||
GetDirListing( VISUALIZATIONS_DIR + "*.mpeg", arrayPossibleMovies, false, true );
|
||||
|
||||
BGAnimation *pTempBGA = NULL;
|
||||
if( arrayPossibleMovies.GetSize() > 0 )
|
||||
if( !arrayPossibleMovies.empty() )
|
||||
{
|
||||
int index = rand() % arrayPossibleMovies.GetSize();
|
||||
unsigned index = rand() % arrayPossibleMovies.size();
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromVisualization( arrayPossibleMovies[index], sSongBackgroundPath );
|
||||
}
|
||||
@@ -262,12 +262,12 @@ void Background::LoadFromSong( Song* pSong )
|
||||
CStringArray arrayPossibleAnims;
|
||||
GetDirListing( BG_ANIMS_DIR+"*.*", arrayPossibleAnims, true, true );
|
||||
// strip out "cvs" and "danger
|
||||
for( int i=arrayPossibleAnims.GetSize()-1; i>=0; i-- )
|
||||
for( int i=arrayPossibleAnims.size()-1; i>=0; i-- )
|
||||
if( 0==stricmp(arrayPossibleAnims[i].Right(3),"cvs") || 0==stricmp(arrayPossibleAnims[i].Right(3),"danger") )
|
||||
arrayPossibleAnims.RemoveAt(i);
|
||||
for( i=0; i<4 && arrayPossibleAnims.GetSize()>0; i++ )
|
||||
for( i=0; i<4 && !arrayPossibleAnims.empty(); i++ )
|
||||
{
|
||||
int index = rand() % arrayPossibleAnims.GetSize();
|
||||
unsigned index = rand() % arrayPossibleAnims.size();
|
||||
BGAnimation *pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromAniDir( arrayPossibleAnims[index], sSongBackgroundPath );
|
||||
m_BGAnimations.Add( pTempBGA );
|
||||
@@ -281,9 +281,9 @@ void Background::LoadFromSong( Song* pSong )
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.avi", arrayPossibleMovies, false, true );
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.mpg", arrayPossibleMovies, false, true );
|
||||
GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", arrayPossibleMovies, false, true );
|
||||
for( int i=0; i<4 && arrayPossibleMovies.GetSize()>0; i++ )
|
||||
for( int i=0; i<4 && !arrayPossibleMovies.empty(); i++ )
|
||||
{
|
||||
int index = rand() % arrayPossibleMovies.GetSize();
|
||||
unsigned index = rand() % arrayPossibleMovies.size();
|
||||
BGAnimation *pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false );
|
||||
m_BGAnimations.Add( pTempBGA );
|
||||
@@ -318,24 +318,24 @@ void Background::LoadFromSong( Song* pSong )
|
||||
/* If we have only 2, only generate a single animation segment for for the
|
||||
* whole song. Otherwise, if it's a movie, it'll loop every four measures; we
|
||||
* want it to play continuously. */
|
||||
if( m_BGAnimations.GetSize() == 2) {
|
||||
if( m_BGAnimations.size() == 2) {
|
||||
m_aBGSegments.Add( BGSegment(fFirstBeat,1,bFade) );
|
||||
} else {
|
||||
// change BG every 4 bars
|
||||
for( float f=fFirstBeat; f<fLastBeat; f+=16 )
|
||||
{
|
||||
int index;
|
||||
if( m_BGAnimations.GetSize()==1 )
|
||||
if( m_BGAnimations.size()==1 )
|
||||
index = 0;
|
||||
else if( f == fFirstBeat )
|
||||
index = 1; // force the first random background to play first
|
||||
else
|
||||
index = 1 + rand()%(m_BGAnimations.GetSize()-1);
|
||||
index = 1 + rand()%(m_BGAnimations.size()-1);
|
||||
m_aBGSegments.Add( BGSegment(f,index,bFade) );
|
||||
}
|
||||
|
||||
// change BG every BPM change
|
||||
for( int i=0; i<pSong->m_BPMSegments.GetSize(); i++ )
|
||||
for( unsigned i=0; i<pSong->m_BPMSegments.size(); i++ )
|
||||
{
|
||||
const BPMSegment& bpmseg = pSong->m_BPMSegments[i];
|
||||
|
||||
@@ -343,10 +343,10 @@ void Background::LoadFromSong( Song* pSong )
|
||||
continue; // skip]
|
||||
|
||||
int index;
|
||||
if( m_BGAnimations.GetSize()==1 )
|
||||
if( m_BGAnimations.size()==1 )
|
||||
index = 0;
|
||||
else
|
||||
index = 1 + int(bpmseg.m_fBPM)%(m_BGAnimations.GetSize()-1);
|
||||
index = 1 + int(bpmseg.m_fBPM)%(m_BGAnimations.size()-1);
|
||||
m_aBGSegments.Add( BGSegment(bpmseg.m_fStartBeat,index,bFade) );
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ void Background::LoadFromSong( Song* pSong )
|
||||
SortBGSegmentArray( m_aBGSegments );
|
||||
}
|
||||
|
||||
for( int i=0; i<m_BGAnimations.GetSize(); i++ )
|
||||
for( unsigned i=0; i<m_BGAnimations.size(); i++ )
|
||||
{
|
||||
m_BGAnimations[i]->SetXY( (float)LEFT_EDGE, (float)TOP_EDGE );
|
||||
m_BGAnimations[i]->SetZoomX( fXZoom );
|
||||
@@ -385,12 +385,13 @@ void Background::Update( float fDeltaTime )
|
||||
return;
|
||||
|
||||
// Find the BGSegment we're in
|
||||
for( int i=0; i<m_aBGSegments.GetSize()-1; i++ )
|
||||
unsigned i;
|
||||
for( i=0; i<m_aBGSegments.size()-1; i++ )
|
||||
if( GAMESTATE->m_fSongBeat < m_aBGSegments[i+1].m_fStartBeat )
|
||||
break;
|
||||
ASSERT( i >= 0 && i<m_aBGSegments.GetSize() );
|
||||
ASSERT( i >= 0 && i<m_aBGSegments.size() );
|
||||
|
||||
if( i > m_iCurBGSegment )
|
||||
if( int(i) > m_iCurBGSegment )
|
||||
{
|
||||
// printf( "%d, %d, %f, %f\n", m_iCurBGSegment, i, m_aBGSegments[i].m_fStartBeat, GAMESTATE->m_fSongBeat );
|
||||
BGAnimation* pOld = GetCurBGA();
|
||||
|
||||
@@ -360,7 +360,7 @@ MusicWheel::MusicWheel()
|
||||
{
|
||||
CStringArray asGroupNames;
|
||||
SONGMAN->GetGroupNames( asGroupNames );
|
||||
if( asGroupNames.GetSize() > 0 )
|
||||
if( !asGroupNames.empty() )
|
||||
{
|
||||
/* XXX: Do groups get added if they're empty?
|
||||
* This will select songs we can't use; we want the first song
|
||||
@@ -368,7 +368,7 @@ MusicWheel::MusicWheel()
|
||||
* -glenn */
|
||||
CArray<Song*, Song*> arraySongs;
|
||||
SONGMAN->GetSongsInGroup( asGroupNames[0], arraySongs );
|
||||
if( arraySongs.GetSize() > 0 ) // still nothing selected
|
||||
if( !arraySongs.empty() ) // still nothing selected
|
||||
GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ MusicWheel::MusicWheel()
|
||||
// Select the the previously selected song (if any)
|
||||
if( GAMESTATE->m_pCurSong )
|
||||
{
|
||||
for( int i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( unsigned i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_pSong == GAMESTATE->m_pCurSong )
|
||||
{
|
||||
@@ -391,7 +391,7 @@ MusicWheel::MusicWheel()
|
||||
// Select the the previously selected course (if any)
|
||||
if( GAMESTATE->m_pCurCourse != NULL )
|
||||
{
|
||||
for( int i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( unsigned i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_pCourse == GAMESTATE->m_pCurCourse )
|
||||
{
|
||||
@@ -418,7 +418,7 @@ CArray<WheelItemData, WheelItemData&>& MusicWheel::GetCurWheelItemDatas()
|
||||
|
||||
void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arrayWheelItemDatas, SongSortOrder so, bool bRoulette )
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
@@ -430,7 +430,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
CArray<Song*, Song*> arraySongs;
|
||||
|
||||
// copy only songs that have at least one Notes for the current GameMode
|
||||
for( i=0; i<SONGMAN->m_pSongs.GetSize(); i++ )
|
||||
for( i=0; i<SONGMAN->m_pSongs.size(); i++ )
|
||||
{
|
||||
Song* pSong = SONGMAN->m_pSongs[i];
|
||||
|
||||
@@ -448,7 +448,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
CArray<Notes*, Notes*> arraySteps;
|
||||
pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps );
|
||||
|
||||
if( arraySteps.GetSize() > 0 )
|
||||
if( !arraySteps.empty() )
|
||||
arraySongs.Add( pSong );
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
// break;
|
||||
case SORT_MOST_PLAYED:
|
||||
SortSongPointerArrayByMostPlayed( arraySongs );
|
||||
if( arraySongs.GetSize() > 30 )
|
||||
if( arraySongs.size() > 30 )
|
||||
arraySongs.erase(arraySongs.begin()+30, arraySongs.end());
|
||||
break;
|
||||
default:
|
||||
@@ -502,7 +502,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
// make WheelItemDatas with sections
|
||||
CString sLastSection = "";
|
||||
RageColor colorSection;
|
||||
for( int i=0; i< arraySongs.GetSize(); i++ )
|
||||
for( unsigned i=0; i< arraySongs.size(); i++ )
|
||||
{
|
||||
Song* pSong = arraySongs[i];
|
||||
CString sThisSection = GetSectionNameFromSongAndSort( pSong, so );
|
||||
@@ -523,7 +523,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i=0; i<arraySongs.GetSize(); i++ )
|
||||
for( unsigned i=0; i<arraySongs.size(); i++ )
|
||||
{
|
||||
Song* pSong = arraySongs[i];
|
||||
if( GAMESTATE->m_sPreferredGroup != "ALL MUSIC" && pSong->m_sGroupName != GAMESTATE->m_sPreferredGroup )
|
||||
@@ -550,7 +550,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
|
||||
bool bFoundExtraSong = false;
|
||||
|
||||
for( int i=0; i<arrayWheelItemDatas.GetSize(); i++ )
|
||||
for( unsigned i=0; i<arrayWheelItemDatas.size(); i++ )
|
||||
{
|
||||
if( arrayWheelItemDatas[i].m_pSong == pSong )
|
||||
{
|
||||
@@ -567,23 +567,23 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
case PLAY_MODE_ONI:
|
||||
case PLAY_MODE_ENDLESS:
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
CArray<Course*,Course*> apCourses;
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_ONI:
|
||||
for( i=0; i<SONGMAN->m_aOniCourses.GetSize(); i++ )
|
||||
for( i=0; i<SONGMAN->m_aOniCourses.size(); i++ )
|
||||
apCourses.Add( &SONGMAN->m_aOniCourses[i] );
|
||||
SortCoursePointerArrayByDifficulty( apCourses );
|
||||
break;
|
||||
case PLAY_MODE_ENDLESS:
|
||||
for( i=0; i<SONGMAN->m_aEndlessCourses.GetSize(); i++ )
|
||||
for( i=0; i<SONGMAN->m_aEndlessCourses.size(); i++ )
|
||||
apCourses.Add( &SONGMAN->m_aEndlessCourses[i] );
|
||||
break;
|
||||
}
|
||||
|
||||
for( int c=0; c<apCourses.GetSize(); c++ ) // foreach course
|
||||
for( unsigned c=0; c<apCourses.size(); c++ ) // foreach course
|
||||
{
|
||||
Course* pCourse = apCourses[c];
|
||||
|
||||
@@ -593,7 +593,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
CStringArray asModifiers;
|
||||
pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, false );
|
||||
|
||||
if( apNotes.GetSize() > 0 )
|
||||
if( !apNotes.empty() )
|
||||
arrayWheelItemDatas.Add( WheelItemData(TYPE_COURSE, NULL, "", pCourse, pCourse->GetColor()) );
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,7 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
}
|
||||
|
||||
// init crowns
|
||||
for( i=0; i<arrayWheelItemDatas.GetSize(); i++ )
|
||||
for( i=0; i<arrayWheelItemDatas.size(); i++ )
|
||||
{
|
||||
Song* pSong = arrayWheelItemDatas[i].m_pSong;
|
||||
if( pSong == NULL )
|
||||
@@ -617,16 +617,14 @@ void MusicWheel::BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arr
|
||||
if( so == SORT_MOST_PLAYED )
|
||||
{
|
||||
// init crown icons
|
||||
for( int i=0; i< min(3,arrayWheelItemDatas.GetSize()); i++ )
|
||||
for( i=0; i< min(3u,arrayWheelItemDatas.size()); i++ )
|
||||
{
|
||||
WheelItemData& WID = arrayWheelItemDatas[i];
|
||||
WID.m_IconType = MusicStatusDisplay::IconType(MusicStatusDisplay::crown1 + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( arrayWheelItemDatas.GetSize() == 0 )
|
||||
if( arrayWheelItemDatas.empty() )
|
||||
{
|
||||
arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, "- EMPTY -", NULL, RageColor(1,0,0,1)) );
|
||||
}
|
||||
@@ -684,7 +682,7 @@ void MusicWheel::RebuildWheelItemDisplays()
|
||||
{
|
||||
// rewind to first index that will be displayed;
|
||||
int iIndex = m_iSelection;
|
||||
if( m_iSelection > GetCurWheelItemDatas().GetSize()-1 )
|
||||
if( m_iSelection > int(GetCurWheelItemDatas().size()-1) )
|
||||
m_iSelection = 0;
|
||||
|
||||
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW/2; i++ )
|
||||
@@ -693,7 +691,7 @@ void MusicWheel::RebuildWheelItemDisplays()
|
||||
{
|
||||
iIndex--;
|
||||
if( iIndex < 0 )
|
||||
iIndex = GetCurWheelItemDatas().GetSize()-1;
|
||||
iIndex = GetCurWheelItemDatas().size()-1;
|
||||
}
|
||||
while( GetCurWheelItemDatas()[iIndex].m_WheelItemType == TYPE_SONG
|
||||
&& GetCurWheelItemDatas()[iIndex].m_sSectionName != ""
|
||||
@@ -712,7 +710,7 @@ void MusicWheel::RebuildWheelItemDisplays()
|
||||
do
|
||||
{
|
||||
iIndex++;
|
||||
if( iIndex > GetCurWheelItemDatas().GetSize()-1 )
|
||||
if( iIndex > int(GetCurWheelItemDatas().size()-1) )
|
||||
iIndex = 0;
|
||||
}
|
||||
while( GetCurWheelItemDatas()[iIndex].m_WheelItemType == TYPE_SONG
|
||||
@@ -773,16 +771,16 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
{
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
|
||||
|
||||
for( int i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
|
||||
unsigned i;
|
||||
for( i=0; i<NUM_WHEEL_ITEMS_TO_DRAW; i++ )
|
||||
{
|
||||
WheelItemDisplay& display = m_WheelItemDisplays[i];
|
||||
|
||||
display.Update( fDeltaTime );
|
||||
}
|
||||
|
||||
float fScrollPercentage = (m_iSelection-m_fPositionOffsetFromSelection) / (float)GetCurWheelItemDatas().GetSize();
|
||||
float fPercentItemsShowing = NUM_WHEEL_ITEMS_TO_DRAW / (float)GetCurWheelItemDatas().GetSize();
|
||||
float fScrollPercentage = (m_iSelection-m_fPositionOffsetFromSelection) / (float)GetCurWheelItemDatas().size();
|
||||
float fPercentItemsShowing = NUM_WHEEL_ITEMS_TO_DRAW / (float)GetCurWheelItemDatas().size();
|
||||
m_ScrollBar.SetPercentage( fScrollPercentage-fPercentItemsShowing/2, fScrollPercentage+fPercentItemsShowing/2 );
|
||||
|
||||
if( m_WheelState == STATE_ROULETTE_SPINNING )
|
||||
@@ -815,7 +813,7 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
if( pPrevSelectedSong != NULL ) // the previous selected item was a song
|
||||
{
|
||||
// find the previously selected song, and select it
|
||||
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_pSong == pPrevSelectedSong )
|
||||
{
|
||||
@@ -827,7 +825,7 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
else // the previously selected item was a section
|
||||
{
|
||||
// find the previously selected song, and select it
|
||||
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_sSectionName == sPrevSelectedSection )
|
||||
{
|
||||
@@ -840,7 +838,7 @@ void MusicWheel::Update( float fDeltaTime )
|
||||
// If changed sort to "BEST", put selection on most popular song
|
||||
if( GAMESTATE->m_SongSortOrder == SORT_MOST_PLAYED )
|
||||
{
|
||||
for( i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_pSong != NULL )
|
||||
{
|
||||
@@ -1006,7 +1004,7 @@ void MusicWheel::PrevMusic( bool bSendSongChangedMessage )
|
||||
{
|
||||
m_iSelection--;
|
||||
if( m_iSelection < 0 )
|
||||
m_iSelection = GetCurWheelItemDatas().GetSize()-1;
|
||||
m_iSelection = GetCurWheelItemDatas().size()-1;
|
||||
}
|
||||
while( (GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG || GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_COURSE)
|
||||
&& GetCurWheelItemDatas()[m_iSelection].m_sSectionName != ""
|
||||
@@ -1050,7 +1048,7 @@ void MusicWheel::NextMusic( bool bSendSongChangedMessage )
|
||||
do
|
||||
{
|
||||
m_iSelection++;
|
||||
if( m_iSelection > GetCurWheelItemDatas().GetSize()-1 )
|
||||
if( m_iSelection > int(GetCurWheelItemDatas().size()-1) )
|
||||
m_iSelection = 0;
|
||||
}
|
||||
while( (GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_SONG || GetCurWheelItemDatas()[m_iSelection].m_WheelItemType == TYPE_COURSE)
|
||||
@@ -1123,7 +1121,7 @@ bool MusicWheel::Select() // return true of a playable item was chosen
|
||||
|
||||
m_iSelection = 0; // reset in case we can't find the last selected song
|
||||
// find the section header and select it
|
||||
for( int i=0; i<GetCurWheelItemDatas().GetSize(); i++ )
|
||||
for( unsigned i=0; i<GetCurWheelItemDatas().size(); i++ )
|
||||
{
|
||||
if( GetCurWheelItemDatas()[i].m_WheelItemType == TYPE_SECTION
|
||||
&& GetCurWheelItemDatas()[i].m_sSectionName == sThisItemSectionName )
|
||||
|
||||
@@ -33,7 +33,7 @@ void SMLoader::LoadFromSMTokens(
|
||||
out.m_iMeter = atoi(sMeter);
|
||||
CStringArray saValues;
|
||||
split( sRadarValues, ",", saValues, true );
|
||||
if( saValues.GetSize() == NUM_RADAR_VALUES )
|
||||
if( saValues.size() == NUM_RADAR_VALUES )
|
||||
for( int r=0; r<NUM_RADAR_VALUES; r++ )
|
||||
out.m_fRadarValues[r] = (float)atof(saValues[r]);
|
||||
|
||||
@@ -139,7 +139,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
CStringArray arrayFreezeExpressions;
|
||||
split( sParams[1], ",", arrayFreezeExpressions );
|
||||
|
||||
for( int f=0; f<arrayFreezeExpressions.GetSize(); f++ )
|
||||
for( unsigned f=0; f<arrayFreezeExpressions.size(); f++ )
|
||||
{
|
||||
CStringArray arrayFreezeValues;
|
||||
split( arrayFreezeExpressions[f], "=", arrayFreezeValues );
|
||||
@@ -161,7 +161,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
CStringArray arrayBPMChangeExpressions;
|
||||
split( sParams[1], ",", arrayBPMChangeExpressions );
|
||||
|
||||
for( int b=0; b<arrayBPMChangeExpressions.GetSize(); b++ )
|
||||
for( unsigned b=0; b<arrayBPMChangeExpressions.size(); b++ )
|
||||
{
|
||||
CStringArray arrayBPMChangeValues;
|
||||
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
|
||||
@@ -181,7 +181,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
||||
CStringArray aBGChangeExpressions;
|
||||
split( sParams[1], ",", aBGChangeExpressions );
|
||||
|
||||
for( int b=0; b<aBGChangeExpressions.GetSize(); b++ )
|
||||
for( unsigned b=0; b<aBGChangeExpressions.size(); b++ )
|
||||
{
|
||||
CStringArray aBGChangeValues;
|
||||
split( aBGChangeExpressions[b], "=", aBGChangeValues );
|
||||
@@ -229,12 +229,12 @@ bool SMLoader::LoadFromDir( CString sPath, Song &out )
|
||||
CStringArray aFileNames;
|
||||
GetApplicableFiles( sPath, aFileNames );
|
||||
|
||||
if( aFileNames.GetSize() > 1 )
|
||||
if( aFileNames.size() > 1 )
|
||||
throw RageException( "There is more than one SM file in '%s'. There should be only one!", sPath.GetString() );
|
||||
|
||||
/* We should have exactly one; if we had none, we shouldn't have been
|
||||
* called to begin with. */
|
||||
ASSERT( aFileNames.GetSize() == 1 );
|
||||
ASSERT( aFileNames.size() == 1 );
|
||||
|
||||
return LoadFromSMFile( sPath + aFileNames[0], out );
|
||||
}
|
||||
|
||||
@@ -51,10 +51,11 @@ ScreenSelectStyle::ScreenSelectStyle()
|
||||
GAMESTATE->m_bPlayersCanJoin = true;
|
||||
|
||||
GAMEMAN->GetGameplayStylesForGame( GAMESTATE->m_CurGame, m_aPossibleStyles );
|
||||
ASSERT( m_aPossibleStyles.GetSize() > 0 ); // every game should have at least one Style, or else why have the Game? :-)
|
||||
ASSERT( !m_aPossibleStyles.empty() ); // every game should have at least one Style, or else why have the Game? :-)
|
||||
m_iSelection = 0;
|
||||
|
||||
for( int i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
unsigned i;
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
m_sprIcon[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style icons %s",GAMESTATE->GetCurrentGameDef()->m_szName) ) );
|
||||
m_sprIcon[i].StopAnimating();
|
||||
@@ -80,7 +81,7 @@ ScreenSelectStyle::ScreenSelectStyle()
|
||||
const StyleDef* pStyleDef = GAMEMAN->GetStyleDefForStyle( m_aPossibleStyles[m_iSelection] );
|
||||
|
||||
// Load dummy Sprites
|
||||
for( i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
m_sprDummyPreview[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style preview %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
m_sprDummyInfo[i].Load( THEME->GetPathTo("Graphics",ssprintf("select style info %s %s",pGameDef->m_szName,pStyleDef->m_szName)) );
|
||||
@@ -217,7 +218,7 @@ void ScreenSelectStyle::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
// search for a style to the right of the current selection that is enabled
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( int i=m_iSelection+1; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
for( unsigned i=m_iSelection+1; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
{
|
||||
@@ -281,8 +282,8 @@ void ScreenSelectStyle::MenuBack( PlayerNumber pn )
|
||||
|
||||
void ScreenSelectStyle::TweenOnScreen()
|
||||
{
|
||||
for( int i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
m_sprIcon[i].FadeOn( (m_aPossibleStyles.GetSize()-i)*0.05f, "Left Accelerate", MENU_ELEMENTS_TWEEN_TIME );
|
||||
for( unsigned i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
m_sprIcon[i].FadeOn( (m_aPossibleStyles.size()-i)*0.05f, "Left Accelerate", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprExplanation.FadeOn( 0, "Right Accelerate", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
@@ -291,7 +292,7 @@ void ScreenSelectStyle::TweenOnScreen()
|
||||
|
||||
void ScreenSelectStyle::TweenOffScreen()
|
||||
{
|
||||
for( int i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
for( unsigned i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
m_sprIcon[i].FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
|
||||
m_sprExplanation.FadeOff( 0, "FoldY", MENU_ELEMENTS_TWEEN_TIME );
|
||||
@@ -322,10 +323,10 @@ bool ScreenSelectStyle::IsEnabled( int iStyleIndex )
|
||||
|
||||
void ScreenSelectStyle::UpdateEnabledDisabled()
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
/* XXX: If a player joins during the tween-in, this diffuse change
|
||||
* will be undone by the tween. Hmm. */
|
||||
for( i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
m_sprIcon[i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
@@ -337,7 +338,7 @@ void ScreenSelectStyle::UpdateEnabledDisabled()
|
||||
BeforeChange();
|
||||
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( i=0; i<m_aPossibleStyles.GetSize(); i++ )
|
||||
for( i=0; i<m_aPossibleStyles.size(); i++ )
|
||||
{
|
||||
if( IsEnabled(i) )
|
||||
{
|
||||
|
||||
@@ -56,13 +56,13 @@ void SongManager::InitSongArrayFromDisk( void(*callback)() )
|
||||
{
|
||||
LoadStepManiaSongDir( "Songs", callback );
|
||||
|
||||
for( int i=0; i<PREFSMAN->m_asAdditionalSongFolders.GetSize(); i++ )
|
||||
for( unsigned i=0; i<PREFSMAN->m_asAdditionalSongFolders.size(); i++ )
|
||||
LoadStepManiaSongDir( PREFSMAN->m_asAdditionalSongFolders[i], callback );
|
||||
|
||||
if( PREFSMAN->m_DWIPath != "" )
|
||||
LoadStepManiaSongDir( PREFSMAN->m_DWIPath + "\\Songs", callback );
|
||||
|
||||
LOG->Trace( "Found %d Songs.", m_pSongs.GetSize() );
|
||||
LOG->Trace( "Found %d Songs.", m_pSongs.size() );
|
||||
}
|
||||
|
||||
void SongManager::SanityCheckGroupDir( CString sDir ) const
|
||||
@@ -72,7 +72,7 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const
|
||||
GetDirListing( sDir + "\\*.mp3", arrayFiles );
|
||||
GetDirListing( sDir + "\\*.ogg", arrayFiles );
|
||||
GetDirListing( sDir + "\\*.wav", arrayFiles );
|
||||
if( arrayFiles.GetSize() > 0 )
|
||||
if( !arrayFiles.empty() )
|
||||
throw RageException(
|
||||
"The folder '%s' contains music files.\n\n"
|
||||
"This means that you have a music outside of a song folder.\n"
|
||||
@@ -85,11 +85,11 @@ void SongManager::SanityCheckGroupDir( CString sDir ) const
|
||||
|
||||
void SongManager::AddGroup( CString sDir, CString sGroupDirName )
|
||||
{
|
||||
int j;
|
||||
for(j = 0; j < m_arrayGroupNames.GetSize(); ++j)
|
||||
unsigned j;
|
||||
for(j = 0; j < m_arrayGroupNames.size(); ++j)
|
||||
if( sGroupDirName == m_arrayGroupNames[j] ) break;
|
||||
|
||||
if( j != m_arrayGroupNames.GetSize() )
|
||||
if( j != m_arrayGroupNames.size() )
|
||||
return; /* the group is already added */
|
||||
|
||||
// Look for a group banner in this group folder
|
||||
@@ -100,7 +100,7 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
|
||||
GetDirListing( ssprintf("%s\\%s\\*.bmp", sDir.GetString(), sGroupDirName.GetString()), arrayGroupBanners );
|
||||
CString sBannerPath;
|
||||
|
||||
if( arrayGroupBanners.GetSize() > 0 )
|
||||
if( !arrayGroupBanners.empty() )
|
||||
{
|
||||
sBannerPath = ssprintf("%s\\%s\\%s", sDir.GetString(), sGroupDirName.GetString(), arrayGroupBanners[0].GetString() );
|
||||
LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.GetString(), sBannerPath.GetString() );
|
||||
@@ -120,7 +120,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
||||
GetDirListing( sDir+"\\*.*", arrayGroupDirs, true );
|
||||
SortCStringArray( arrayGroupDirs );
|
||||
|
||||
for( int i=0; i< arrayGroupDirs.GetSize(); i++ ) // for each dir in /Songs/
|
||||
for( unsigned i=0; i< arrayGroupDirs.size(); i++ ) // for each dir in /Songs/
|
||||
{
|
||||
CString sGroupDirName = arrayGroupDirs[i];
|
||||
|
||||
@@ -134,10 +134,10 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
||||
GetDirListing( ssprintf("%s\\%s\\*.*", sDir.GetString(), sGroupDirName.GetString()), arraySongDirs, true );
|
||||
SortCStringArray( arraySongDirs );
|
||||
|
||||
int j;
|
||||
unsigned j;
|
||||
int loaded = 0;
|
||||
|
||||
for( j=0; j< arraySongDirs.GetSize(); j++ ) // for each song dir
|
||||
for( j=0; j< arraySongDirs.size(); j++ ) // for each song dir
|
||||
{
|
||||
CString sSongDirName = arraySongDirs[j];
|
||||
|
||||
@@ -192,7 +192,7 @@ void SongManager::LoadDWISongDir( CString DWIHome )
|
||||
GetDirListing( ssprintf("%s\\Songs\\*.*", DWIHome ), MixDirs.GetString(), true );
|
||||
SortCStringArray( MixDirs );
|
||||
|
||||
for( int i=0; i< MixDirs.GetSize(); i++ ) // for each dir in /Songs/
|
||||
for( unsigned i=0; i< MixDirs.size(); i++ ) // for each dir in /Songs/
|
||||
{
|
||||
// the dir name will most likely be something like
|
||||
// Dance Dance Revolution 4th Mix, etc.
|
||||
@@ -203,14 +203,14 @@ void SongManager::LoadDWISongDir( CString DWIHome )
|
||||
GetDirListing( ssprintf("%s\\Songs\\%s\\*.*", DWIHome.GetString(), MixDirs[i].GetString()), arrayDirs, true);
|
||||
SortCStringArray(arrayDirs, true);
|
||||
|
||||
for( int b = 0; b < arrayDirs.GetSize(); b++)
|
||||
for( unsigned b = 0; b < arrayDirs.size(); b++)
|
||||
{
|
||||
// Find all DWIs in this directory
|
||||
CStringArray arrayDWIFiles;
|
||||
GetDirListing( ssprintf("%s\\Songs\\%s\\%s\\*.dwi", DWIHome.GetString(), MixDirs[i].GetString(), arrayDirs[b].GetString()), arrayDWIFiles, false);
|
||||
SortCStringArray( arrayDWIFiles );
|
||||
|
||||
for( int j=0; j< arrayDWIFiles.GetSize(); j++ ) // for each DWI file
|
||||
for( unsigned j=0; j< arrayDWIFiles.size(); j++ ) // for each DWI file
|
||||
{
|
||||
CString sDWIFileName = arrayDWIFiles[j];
|
||||
sDWIFileName.MakeLower();
|
||||
@@ -231,7 +231,7 @@ void SongManager::LoadDWISongDir( CString DWIHome )
|
||||
|
||||
void SongManager::FreeSongArray()
|
||||
{
|
||||
for( int i=0; i<m_pSongs.GetSize(); i++ )
|
||||
for( unsigned i=0; i<m_pSongs.size(); i++ )
|
||||
SAFE_DELETE( m_pSongs[i] );
|
||||
m_pSongs.clear();
|
||||
|
||||
@@ -272,7 +272,7 @@ void SongManager::ReadStatisticsFromDisk()
|
||||
char szNotesType[256];
|
||||
char szNotesDescription[256];
|
||||
int iRetVal;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
// Parse for Song name and Notes name
|
||||
iRetVal = sscanf( name, "%[^:]::%[^:]::%[^\n]", szSongDir, szNotesType, szNotesDescription );
|
||||
@@ -283,7 +283,7 @@ void SongManager::ReadStatisticsFromDisk()
|
||||
|
||||
// Search for the corresponding Song pointer.
|
||||
Song* pSong = NULL;
|
||||
for( i=0; i<m_pSongs.GetSize(); i++ )
|
||||
for( i=0; i<m_pSongs.size(); i++ )
|
||||
{
|
||||
if( m_pSongs[i]->m_sSongDir == szSongDir ) // match!
|
||||
{
|
||||
@@ -297,7 +297,7 @@ void SongManager::ReadStatisticsFromDisk()
|
||||
|
||||
// Search for the corresponding Notes pointer.
|
||||
Notes* pNotes = NULL;
|
||||
for( i=0; i<pSong->m_apNotes.GetSize(); i++ )
|
||||
for( i=0; i<pSong->m_apNotes.size(); i++ )
|
||||
{
|
||||
if( pSong->m_apNotes[i]->m_NotesType == notesType &&
|
||||
pSong->m_apNotes[i]->m_sDescription == szNotesDescription ) // match!
|
||||
@@ -335,11 +335,11 @@ void SongManager::SaveStatisticsToDisk()
|
||||
ini.SetPath( g_sStatisticsFileName );
|
||||
|
||||
// save song statistics
|
||||
for( int i=0; i<m_pSongs.GetSize(); i++ ) // for each Song
|
||||
for( unsigned i=0; i<m_pSongs.size(); i++ ) // for each Song
|
||||
{
|
||||
Song* pSong = m_pSongs[i];
|
||||
|
||||
for( int j=0; j<pSong->m_apNotes.GetSize(); j++ ) // for each Notes
|
||||
for( unsigned j=0; j<pSong->m_apNotes.size(); j++ ) // for each Notes
|
||||
{
|
||||
Notes* pNotes = pSong->m_apNotes[j];
|
||||
|
||||
@@ -367,11 +367,11 @@ void SongManager::SaveStatisticsToDisk()
|
||||
|
||||
CString SongManager::GetGroupBannerPath( CString sGroupName )
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < m_arrayGroupNames.GetSize(); ++i)
|
||||
unsigned i;
|
||||
for(i = 0; i < m_arrayGroupNames.size(); ++i)
|
||||
if( sGroupName == m_arrayGroupNames[i] ) break;
|
||||
|
||||
if( i == m_arrayGroupNames.GetSize() )
|
||||
if( i == m_arrayGroupNames.size() )
|
||||
return "";
|
||||
|
||||
return m_GroupBannerPaths[i];
|
||||
@@ -385,12 +385,13 @@ void SongManager::GetGroupNames( CStringArray &AddTo )
|
||||
RageColor SongManager::GetGroupColor( const CString &sGroupName )
|
||||
{
|
||||
// search for the group index
|
||||
for( int i=0; i<m_arrayGroupNames.GetSize(); i++ )
|
||||
unsigned i;
|
||||
for( i=0; i<m_arrayGroupNames.size(); i++ )
|
||||
{
|
||||
if( m_arrayGroupNames[i] == sGroupName )
|
||||
break;
|
||||
}
|
||||
ASSERT( i != m_arrayGroupNames.GetSize() ); // this is not a valid group
|
||||
ASSERT( i != m_arrayGroupNames.size() ); // this is not a valid group
|
||||
|
||||
return g_GroupColors[i%NUM_GROUP_COLORS];
|
||||
}
|
||||
@@ -398,7 +399,7 @@ RageColor SongManager::GetGroupColor( const CString &sGroupName )
|
||||
RageColor SongManager::GetSongColor( Song* pSong )
|
||||
{
|
||||
ASSERT( pSong );
|
||||
for( int i=0; i<pSong->m_apNotes.GetSize(); i++ )
|
||||
for( unsigned i=0; i<pSong->m_apNotes.size(); i++ )
|
||||
{
|
||||
Notes* pNotes = pSong->m_apNotes[i];
|
||||
if( pNotes->m_iMeter == 10 )
|
||||
@@ -411,7 +412,7 @@ RageColor SongManager::GetSongColor( Song* pSong )
|
||||
|
||||
void SongManager::GetSongsInGroup( const CString sGroupName, CArray<Song*, Song*> &AddTo )
|
||||
{
|
||||
for( int i=0; i<m_pSongs.GetSize(); i++ )
|
||||
for( unsigned i=0; i<m_pSongs.size(); i++ )
|
||||
{
|
||||
Song* pSong = m_pSongs[i];
|
||||
if( sGroupName == m_pSongs[i]->m_sGroupName )
|
||||
@@ -447,7 +448,7 @@ void SongManager::InitCoursesFromDisk()
|
||||
//
|
||||
CStringArray saCourseFiles;
|
||||
GetDirListing( "Courses\\*.crs", saCourseFiles );
|
||||
for( int i=0; i<saCourseFiles.GetSize(); i++ )
|
||||
for( unsigned i=0; i<saCourseFiles.size(); i++ )
|
||||
{
|
||||
Course course;
|
||||
course.LoadFromCRSFile( "Courses\\" + saCourseFiles[i], m_pSongs );
|
||||
@@ -460,7 +461,8 @@ void SongManager::InitCoursesFromDisk()
|
||||
//
|
||||
CStringArray saGroupNames;
|
||||
this->GetGroupNames( saGroupNames );
|
||||
for( int g=0; g<saGroupNames.GetSize(); g++ ) // foreach Group
|
||||
unsigned g;
|
||||
for( g=0; g<saGroupNames.size(); g++ ) // foreach Group
|
||||
{
|
||||
CString sGroupName = saGroupNames[g];
|
||||
CArray<Song*, Song*> apGroupSongs;
|
||||
@@ -480,12 +482,12 @@ void SongManager::InitCoursesFromDisk()
|
||||
//
|
||||
// Load extra stages
|
||||
//
|
||||
for( g=0; g<saGroupNames.GetSize(); g++ ) // foreach Group
|
||||
for( g=0; g<saGroupNames.size(); g++ ) // foreach Group
|
||||
{
|
||||
CString sGroupName = saGroupNames[g];
|
||||
CStringArray saCoursePaths;
|
||||
GetDirListing( "Songs\\" + sGroupName + "\\*.crs", saCoursePaths, false, true );
|
||||
for( int i=0; i<saCoursePaths.GetSize(); i++ )
|
||||
for( unsigned i=0; i<saCoursePaths.size(); i++ )
|
||||
{
|
||||
Course course;
|
||||
course.LoadFromCRSFile( saCoursePaths[i], m_pSongs );
|
||||
@@ -538,13 +540,13 @@ void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, cons
|
||||
|
||||
CArray<Song*,Song*> apSongs;
|
||||
SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, apSongs );
|
||||
for( int s=0; s<apSongs.GetSize(); s++ ) // foreach song
|
||||
for( unsigned s=0; s<apSongs.size(); s++ ) // foreach song
|
||||
{
|
||||
Song* pSong = apSongs[s];
|
||||
|
||||
CArray<Notes*,Notes*> apNotes;
|
||||
pSong->GetNotesThatMatch( sd->m_NotesType, apNotes );
|
||||
for( int n=0; n<apNotes.GetSize(); n++ ) // foreach Notes
|
||||
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Notes
|
||||
{
|
||||
Notes* pNotes = apNotes[n];
|
||||
|
||||
@@ -603,15 +605,15 @@ void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, cons
|
||||
/* Pick a random song (for the demonstration). */
|
||||
bool SongManager::ChooseRandomSong()
|
||||
{
|
||||
if( SONGMAN->m_pSongs.GetSize() == 0 )
|
||||
if( SONGMAN->m_pSongs.empty() )
|
||||
return false;
|
||||
|
||||
int i;
|
||||
for( i=0; i<600; i++ ) // try 600 times
|
||||
{
|
||||
Song* pSong = m_pSongs[ rand()%m_pSongs.GetSize() ];
|
||||
Song* pSong = m_pSongs[ rand()%m_pSongs.size() ];
|
||||
|
||||
if( pSong->m_apNotes.GetSize() == 0 )
|
||||
if( pSong->m_apNotes.empty() )
|
||||
continue; // skip
|
||||
|
||||
if( !pSong->HasMusic() )
|
||||
@@ -619,7 +621,7 @@ bool SongManager::ChooseRandomSong()
|
||||
|
||||
for( int j=0; j<3; j++ ) // try 3 times
|
||||
{
|
||||
Notes* pNotes = pSong->m_apNotes[ rand()%pSong->m_apNotes.GetSize() ];
|
||||
Notes* pNotes = pSong->m_apNotes[ rand()%pSong->m_apNotes.size() ];
|
||||
if( pNotes->m_NotesType != GAMESTATE->GetCurrentStyleDef()->m_NotesType )
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user