some MFCisms to STLisms (both currently work on CArray)

This commit is contained in:
Glenn Maynard
2002-10-24 19:53:13 +00:00
parent feefd5bf9d
commit d5b1f36775
3 changed files with 6 additions and 7 deletions
+4 -4
View File
@@ -86,12 +86,12 @@ bool IniFile::ReadFile()
void IniFile::WriteFile()
{
FILE* fp = fopen( path, "w" );
for (int keynum = 0; keynum <= names.GetUpperBound(); keynum++)
for (unsigned keynum = 0; keynum < names.size(); keynum++)
{
if (keys[keynum].names.GetSize() != 0)
{
fprintf( fp, "[%s]\n", names[keynum] );
for (int valuenum = 0; valuenum <= keys[keynum].names.GetUpperBound(); valuenum++)
for (unsigned valuenum = 0; valuenum < keys[keynum].names.size(); valuenum++)
fprintf( fp, "%s=%s\n", keys[keynum].names[valuenum], keys[keynum].values[valuenum] );
fprintf( fp, "\n" );
}
@@ -102,8 +102,8 @@ void IniFile::WriteFile()
//deletes all stored ini data
void IniFile::Reset()
{
keys.SetSize(0);
names.SetSize(0);
keys.clear();
names.clear();
}
//returns number of keys currently in the ini
+1 -2
View File
@@ -307,8 +307,7 @@ MusicWheel::MusicWheel()
// init m_mapGroupNameToBannerColor
CArray<Song*, Song*> arraySongs;
arraySongs.Copy( SONGMAN->m_pSongs );
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByGroup( arraySongs );
m_sExpandedSectionName = "";
+1 -1
View File
@@ -166,7 +166,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Notes &out )
// valuename, sNoteData, iMeasureNo, iNoteNum, iNumNotesInThisMeasure );
for( int j=0; j<iNumNotesInThisMeasure; j++ )
{
if( arrayNotes.GetAt(j) == TRUE )
if( arrayNotes[j] )
{
float fPercentThroughMeasure = (float)j/(float)iNumNotesInThisMeasure;