some s/GetSize/size/

This commit is contained in:
Glenn Maynard
2002-10-31 02:11:52 +00:00
parent b30fcbae96
commit 8e18d84d10
4 changed files with 34 additions and 33 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ void ActorFrame::AddChild( Actor* pActor)
void ActorFrame::DrawPrimitives() void ActorFrame::DrawPrimitives()
{ {
// draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space // draw all sub-ActorFrames while we're in the ActorFrame's local coordinate space
for( int i=0; i<m_SubActors.GetSize(); i++ ) { for( unsigned i=0; i<m_SubActors.size(); i++ ) {
m_SubActors[i]->Draw(); m_SubActors[i]->Draw();
} }
} }
@@ -36,7 +36,7 @@ void ActorFrame::Update( float fDeltaTime )
// update all sub-Actors // update all sub-Actors
for( int i=0; i<m_SubActors.GetSize(); i++ ) for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->Update(fDeltaTime); m_SubActors[i]->Update(fDeltaTime);
} }
@@ -46,6 +46,6 @@ void ActorFrame::SetDiffuse( RageColor c )
Actor::SetDiffuse( c ); Actor::SetDiffuse( c );
// set all sub-Actors // set all sub-Actors
for( int i=0; i<m_SubActors.GetSize(); i++ ) for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->SetDiffuse(c ); m_SubActors[i]->SetDiffuse(c );
} }
+7 -7
View File
@@ -31,13 +31,13 @@ void AnnouncerManager::GetAnnouncerNames( CStringArray& AddTo )
GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true ); GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true );
// strip out the folder called "CVS" and EMPTY_ANNOUNCER_NAME // strip out the folder called "CVS" and EMPTY_ANNOUNCER_NAME
for( int i=AddTo.GetSize()-1; i>=0; i-- ) for( int i=AddTo.size()-1; i>=0; i-- )
{ if( !stricmp( AddTo[i], "cvs" ) )
if( 0 == stricmp( AddTo[i], "cvs" ) )
AddTo.RemoveAt(i); AddTo.RemoveAt(i);
if( 0 == stricmp( AddTo[i], EMPTY_ANNOUNCER_NAME ) )
for( int i=AddTo.size()-1; i>=0; i-- )
if( !stricmp( AddTo[i], EMPTY_ANNOUNCER_NAME ) )
AddTo.RemoveAt(i); AddTo.RemoveAt(i);
}
} }
bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName )
@@ -47,7 +47,7 @@ bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName )
CStringArray asAnnouncerNames; CStringArray asAnnouncerNames;
GetAnnouncerNames( asAnnouncerNames ); GetAnnouncerNames( asAnnouncerNames );
for( int i=0; i<asAnnouncerNames.GetSize(); i++ ) for( unsigned i=0; i<asAnnouncerNames.size(); i++ )
if( 0==stricmp(sAnnouncerName, asAnnouncerNames[i]) ) if( 0==stricmp(sAnnouncerName, asAnnouncerNames[i]) )
return true; return true;
return false; return false;
@@ -94,5 +94,5 @@ bool AnnouncerManager::HasSoundsFor( CString sFolderName )
{ {
CStringArray asFileNames; CStringArray asFileNames;
GetDirListing( GetPathTo(sFolderName), asFileNames ); GetDirListing( GetPathTo(sFolderName), asFileNames );
return asFileNames.GetSize() > 0; return !asFileNames.empty();
} }
+10 -9
View File
@@ -37,7 +37,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
GetDirListing( "Courses\\" + sFName + ".jpg", arrayPossibleBanners, false, true ); GetDirListing( "Courses\\" + sFName + ".jpg", arrayPossibleBanners, false, true );
GetDirListing( "Courses\\" + sFName + ".bmp", arrayPossibleBanners, false, true ); GetDirListing( "Courses\\" + sFName + ".bmp", arrayPossibleBanners, false, true );
GetDirListing( "Courses\\" + sFName + ".gif", arrayPossibleBanners, false, true ); GetDirListing( "Courses\\" + sFName + ".gif", arrayPossibleBanners, false, true );
if( arrayPossibleBanners.GetSize() > 0 ) if( !arrayPossibleBanners.empty() )
m_sBannerPath = arrayPossibleBanners[0]; m_sBannerPath = arrayPossibleBanners[0];
for( int i=0; i<msd.m_iNumValues; i++ ) for( int i=0; i<msd.m_iNumValues; i++ )
@@ -97,7 +97,7 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
CStringArray split_SongDir; CStringArray split_SongDir;
split( sSongDir, "\\", split_SongDir, true ); split( sSongDir, "\\", split_SongDir, true );
if( split_SongDir.GetSize() > 2 ) if( split_SongDir.size() > 2 )
{ {
LOG->Warn( "Course file \"%s\" path \"%s\" should contain " LOG->Warn( "Course file \"%s\" path \"%s\" should contain "
"at most one backslash; ignored.", "at most one backslash; ignored.",
@@ -107,14 +107,14 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
Song *pSong = NULL; Song *pSong = NULL;
// foreach song // foreach song
for( int i = 0; pSong == NULL && i < apSongs.GetSize(); i++ ) for( unsigned i = 0; pSong == NULL && i < apSongs.size(); i++ )
{ {
CStringArray splitted; CStringArray splitted;
split( apSongs[i]->m_sSongDir, "\\", splitted, true ); split( apSongs[i]->m_sSongDir, "\\", splitted, true );
bool matches = true; bool matches = true;
int split_no = splitted.GetSize()-1; int split_no = splitted.size()-1;
int SongDir_no = split_SongDir.GetSize()-1; int SongDir_no = split_SongDir.size()-1;
while( split_no >= 0 && SongDir_no >= 0 ) { while( split_no >= 0 && SongDir_no >= 0 ) {
if( stricmp(splitted[split_no--], split_SongDir[SongDir_no--] ) ) if( stricmp(splitted[split_no--], split_SongDir[SongDir_no--] ) )
@@ -147,7 +147,7 @@ void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Diff
GetDirListing( "Songs\\" + sGroupName + "\\banner.jpg", asPossibleBannerPaths, false, true ); GetDirListing( "Songs\\" + sGroupName + "\\banner.jpg", asPossibleBannerPaths, false, true );
GetDirListing( "Songs\\" + sGroupName + "\\banner.gif", asPossibleBannerPaths, false, true ); GetDirListing( "Songs\\" + sGroupName + "\\banner.gif", asPossibleBannerPaths, false, true );
GetDirListing( "Songs\\" + sGroupName + "\\banner.bmp", asPossibleBannerPaths, false, true ); GetDirListing( "Songs\\" + sGroupName + "\\banner.bmp", asPossibleBannerPaths, false, true );
if( asPossibleBannerPaths.GetSize() > 0 ) if( !asPossibleBannerPaths.empty() )
m_sBannerPath = asPossibleBannerPaths[0]; m_sBannerPath = asPossibleBannerPaths[0];
CString sShortGroupName = SONGMAN->ShortenGroupName( sGroupName ); CString sShortGroupName = SONGMAN->ShortenGroupName( sGroupName );
@@ -160,7 +160,7 @@ void Course::CreateEndlessCourseFromGroupAndDifficulty( CString sGroupName, Diff
case DIFFICULTY_HARD: m_sName += "Hard"; break; case DIFFICULTY_HARD: m_sName += "Hard"; break;
} }
for( int s=0; s<apSongsInGroup.GetSize(); s++ ) for( unsigned s=0; s<apSongsInGroup.size(); s++ )
{ {
Song* pSong = apSongsInGroup[s]; Song* pSong = apSongsInGroup[s];
AddStage( pSong, DifficultyToString(dc), "" ); AddStage( pSong, DifficultyToString(dc), "" );
@@ -179,8 +179,9 @@ Notes* Course::GetNotesForStage( int iStage )
{ {
Song* pSong = m_apSongs[iStage]; Song* pSong = m_apSongs[iStage];
CString sDescription = m_asDescriptions[iStage]; CString sDescription = m_asDescriptions[iStage];
unsigned i;
for( int i=0; i<pSong->m_apNotes.GetSize(); i++ ) for( i=0; i<pSong->m_apNotes.size(); i++ )
{ {
Notes* pNotes = pSong->m_apNotes[i]; Notes* pNotes = pSong->m_apNotes[i];
if( 0==stricmp(pNotes->m_sDescription, sDescription) && if( 0==stricmp(pNotes->m_sDescription, sDescription) &&
@@ -192,7 +193,7 @@ Notes* Course::GetNotesForStage( int iStage )
// Didn't find a matching description. Try to match the Difficulty instead. // Didn't find a matching description. Try to match the Difficulty instead.
Difficulty dc = Notes::DifficultyFromDescriptionAndMeter( sDescription, 5 ); Difficulty dc = Notes::DifficultyFromDescriptionAndMeter( sDescription, 5 );
for( i=0; i<pSong->m_apNotes.GetSize(); i++ ) for( i=0; i<pSong->m_apNotes.size(); i++ )
{ {
Notes* pNotes = pSong->m_apNotes[i]; Notes* pNotes = pSong->m_apNotes[i];
if( pNotes->m_Difficulty == dc && if( pNotes->m_Difficulty == dc &&
+13 -13
View File
@@ -37,7 +37,7 @@ float TimeToSeconds( CString sHMS )
CStringArray arrayBits; CStringArray arrayBits;
split( sHMS, ":", arrayBits, false ); split( sHMS, ":", arrayBits, false );
while( arrayBits.GetSize() < 3 ) while( arrayBits.size() < 3 )
arrayBits.insert(arrayBits.begin(), "0" ); // pad missing bits arrayBits.insert(arrayBits.begin(), "0" ); // pad missing bits
float fSeconds = 0; float fSeconds = 0;
@@ -96,13 +96,13 @@ CString vssprintf( const char *fmt, va_list argList)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
CString join( const CString &Deliminator, const CStringArray& Source) CString join( const CString &Deliminator, const CStringArray& Source)
{ {
if( Source.GetSize() == 0 ) if( Source.empty() )
return ""; return "";
CString csTmp; CString csTmp;
// Loop through the Array and Append the Deliminator // Loop through the Array and Append the Deliminator
for( int iNum = 0; iNum < Source.GetSize()-1; iNum++ ) { for( unsigned iNum = 0; iNum < Source.size()-1; iNum++ ) {
csTmp += Source[iNum]; csTmp += Source[iNum];
csTmp += Deliminator; csTmp += Deliminator;
} }
@@ -227,14 +227,14 @@ void splitrelpath( const CString &Path, CString& Dir, CString& FName, CString& E
FName = ""; FName = "";
Ext = ""; Ext = "";
} }
else if( sFNameAndExtBits.GetSize() == 1 ) // file doesn't have extension else if( sFNameAndExtBits.size() == 1 ) // file doesn't have extension
{ {
FName = sFNameAndExtBits[0]; FName = sFNameAndExtBits[0];
Ext = ""; Ext = "";
} }
else if( sFNameAndExtBits.GetSize() > 1 ) // file has extension and possibly multiple periods else if( sFNameAndExtBits.size() > 1 ) // file has extension and possibly multiple periods
{ {
Ext = sFNameAndExtBits[ sFNameAndExtBits.GetSize()-1 ]; Ext = sFNameAndExtBits[ sFNameAndExtBits.size()-1 ];
// subtract the Ext and last period from FNameAndExt // subtract the Ext and last period from FNameAndExt
FName = sFNameAndExt.Left( sFNameAndExt.GetLength()-Ext.GetLength()-1 ); FName = sFNameAndExt.Left( sFNameAndExt.GetLength()-Ext.GetLength()-1 );
@@ -249,7 +249,7 @@ bool CreateDirectories( CString Path )
Path.Replace("\\", "/"); Path.Replace("\\", "/");
split(Path, "/", parts); split(Path, "/", parts);
for(int i = 0; i < parts.GetSize(); ++i) for(unsigned i = 0; i < parts.size(); ++i)
{ {
curpath += parts[i] + "/"; curpath += parts[i] + "/";
if(CreateDirectory( curpath, NULL )) if(CreateDirectory( curpath, NULL ))
@@ -340,7 +340,7 @@ private:
void DirCache::FlushCache() void DirCache::FlushCache()
{ {
for(int i = 0; i < directory_cache.GetSize(); ++i) for(unsigned i = 0; i < directory_cache.size(); ++i)
delete directory_cache[i]; delete directory_cache[i];
directory_cache.clear(); directory_cache.clear();
} }
@@ -389,11 +389,11 @@ DirCache::CacheEntry *DirCache::LoadDirCache( const CString &sPath )
/* Return a CacheEntry object for a directory, reading it if necessary. */ /* Return a CacheEntry object for a directory, reading it if necessary. */
const DirCache::CacheEntry *DirCache::SearchDirCache( const CString &sPath ) const DirCache::CacheEntry *DirCache::SearchDirCache( const CString &sPath )
{ {
int i; unsigned i;
for(i = 0; i < directory_cache.GetSize(); ++i) for(i = 0; i < directory_cache.size(); ++i)
if(directory_cache[i]->dir == sPath) break; if(directory_cache[i]->dir == sPath) break;
if(i == directory_cache.GetSize()) if(i == directory_cache.size())
/* Didn't find it. */ /* Didn't find it. */
return LoadDirCache( sPath ); return LoadDirCache( sPath );
@@ -436,7 +436,7 @@ bool GetExtDirListingV( const CString &sPath, CStringArray &AddTo, bool bOnlyDir
const DirCache::CacheEntry *cache = DirectoryCache.SearchDirCache(sDir); const DirCache::CacheEntry *cache = DirectoryCache.SearchDirCache(sDir);
if(!cache) return false; if(!cache) return false;
for(int i = 0; i < cache->files.GetSize(); ++i) for(unsigned i = 0; i < cache->files.size(); ++i)
{ {
if( bOnlyDirs && !(cache->Attributes[i] & FILE_ATTRIBUTE_DIRECTORY) ) if( bOnlyDirs && !(cache->Attributes[i] & FILE_ATTRIBUTE_DIRECTORY) )
continue; // skip continue; // skip
@@ -630,7 +630,7 @@ unsigned int GetHashForDirectory( CString sDir )
CStringArray arrayFiles; CStringArray arrayFiles;
GetDirListing( sDir+"\\*.*", arrayFiles, false ); GetDirListing( sDir+"\\*.*", arrayFiles, false );
for( int i=0; i<arrayFiles.GetSize(); i++ ) for( unsigned i=0; i<arrayFiles.size(); i++ )
{ {
const CString sFilePath = sDir + arrayFiles[i]; const CString sFilePath = sDir + arrayFiles[i];
hash += GetHashForFile( sFilePath ); hash += GetHashForFile( sFilePath );