some more MFCisms to STLisms

This commit is contained in:
Glenn Maynard
2002-10-24 19:55:09 +00:00
parent d5b1f36775
commit 85e409b121
8 changed files with 12 additions and 16 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ private:
unsigned GetBPP(D3DFORMAT fmt) const;
HRESULT SetMode();
D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP);
D3DXMATRIX& GetTopMatrix() { return m_MatrixStack.ElementAt( m_MatrixStack.GetSize()-1 ); };
D3DXMATRIX& GetTopMatrix() { return m_MatrixStack.back(); }
HWND m_hWnd;
+3 -4
View File
@@ -37,7 +37,7 @@ float TimeToSeconds( CString sHMS )
split( sHMS, ":", arrayBits, false );
while( arrayBits.GetSize() < 3 )
arrayBits.InsertAt( 0, "0" ); // pad missing bits
arrayBits.insert(arrayBits.begin(), "0" ); // pad missing bits
float fSeconds = 0;
fSeconds += atoi( arrayBits[0] ) * 60 * 60;
@@ -98,15 +98,14 @@ CString join( const CString &Deliminator, const CStringArray& Source)
if( Source.GetSize() == 0 )
return "";
CString csReturn;
CString csTmp;
// Loop through the Array and Append the Deliminator
for( int iNum = 0; iNum < Source.GetSize()-1; iNum++ ) {
csTmp += Source.GetAt(iNum);
csTmp += Source[iNum];
csTmp += Deliminator;
}
csTmp += Source.GetAt( Source.GetSize()-1 );
csTmp += Source.back();
return csTmp;
}
+2 -2
View File
@@ -241,8 +241,8 @@ void ScreenManager::SetNewScreen( Screen *pNewScreen )
{
RefreshCreditsMessages();
// move current screen to ScreenToDelete
m_ScreensToDelete.Copy( m_ScreenStack );
// move current screen(s) to ScreenToDelete
m_ScreensToDelete.insert(m_ScreensToDelete.end(), m_ScreenStack.begin(), m_ScreenStack.end());
m_ScreenStack.RemoveAll();
m_ScreenStack.Add( pNewScreen );
+1 -2
View File
@@ -144,8 +144,7 @@ ScreenMusicScroll::ScreenMusicScroll()
this->AddChild( &m_Background );
CArray<Song*, Song*> arraySongs;
arraySongs.Copy( SONGMAN->m_pSongs );
CArray<Song*, Song*> arraySongs = SONGMAN->m_pSongs;
SortSongPointerArrayByTitle( arraySongs );
m_iNumLines = 0;
+2 -3
View File
@@ -66,8 +66,7 @@ ScreenSelectGroup::ScreenSelectGroup()
// This will simply the code a bit, and fix a weird case that
// causes a crash when there are duplicate song names.
CArray<Song*, Song*> aAllSongs;
aAllSongs.Copy( SONGMAN->m_pSongs );
CArray<Song*, Song*> aAllSongs = SONGMAN->m_pSongs;
// Filter out Songs that can't be played by the current Style
for( i=aAllSongs.GetSize()-1; i>=0; i-- ) // foreach Song, back to front
@@ -91,7 +90,7 @@ ScreenSelectGroup::ScreenSelectGroup()
asGroupNames.RemoveAt( i );
}
asGroupNames.InsertAt(0, "ALL MUSIC" );
asGroupNames.insert(asGroupNames.begin(), "ALL MUSIC" );
// Add songs to the MusicList.
for( int j=0; j < asGroupNames.GetSize(); j++ ) /* for each group */
+1 -1
View File
@@ -379,7 +379,7 @@ CString SongManager::GetGroupBannerPath( CString sGroupName )
void SongManager::GetGroupNames( CStringArray &AddTo )
{
AddTo.Copy( m_arrayGroupNames );
AddTo.insert(AddTo.end(), m_arrayGroupNames.begin(), m_arrayGroupNames.end() );
}
D3DXCOLOR SongManager::GetGroupColor( const CString &sGroupName )
+1 -1
View File
@@ -860,7 +860,7 @@ void Update()
static InputEventArray ieArray;
ieArray.SetSize( 0, 20 ); // zero the array
ieArray.clear(); // empty the array
INPUTFILTER->GetInputEvents( ieArray, fDeltaTime );
for( int i=0; i<ieArray.GetSize(); i++ )
+1 -2
View File
@@ -35,8 +35,7 @@ TipDisplay::TipDisplay()
void TipDisplay::SetTips( CStringArray &arrayTips )
{
m_arrayTips.RemoveAll();
m_arrayTips.Copy( arrayTips );
m_arrayTips = arrayTips;
if( m_arrayTips.GetSize() > 0 )
m_textTip.SetText( m_arrayTips[0] );
}