From bccaf3560bc7e3a46e660b60ad49b2a1217b92d6 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 31 Oct 2002 04:23:39 +0000 Subject: [PATCH] s/Add/push_back/ --- stepmania/src/ActorFrame.cpp | 2 +- stepmania/src/BGAnimation.cpp | 10 ++++----- stepmania/src/Background.cpp | 30 +++++++++++++------------- stepmania/src/Course.cpp | 6 +++--- stepmania/src/GameManager.cpp | 8 +++---- stepmania/src/GroupList.cpp | 2 +- stepmania/src/InputFilter.cpp | 6 +++--- stepmania/src/InputQueue.cpp | 4 ++-- stepmania/src/MenuElements.cpp | 12 +++++------ stepmania/src/MusicList.cpp | 2 +- stepmania/src/MusicWheel.cpp | 20 ++++++++--------- stepmania/src/NoteData.cpp | 10 ++++----- stepmania/src/NoteDisplay.cpp | 4 ++-- stepmania/src/Notes.cpp | 2 +- stepmania/src/NotesLoaderBMS.cpp | 6 +++--- stepmania/src/NotesLoaderDWI.cpp | 2 +- stepmania/src/NotesLoaderKSF.cpp | 2 +- stepmania/src/NotesLoaderSM.cpp | 2 +- stepmania/src/RageDisplay.cpp | 16 +++++++------- stepmania/src/RageTexture.cpp | 2 +- stepmania/src/RageUtil.cpp | 18 ++++++++-------- stepmania/src/RandomSample.cpp | 2 +- stepmania/src/Screen.cpp | 2 +- stepmania/src/ScreenEdit.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 26 +++++++++++----------- stepmania/src/ScreenEz2SelectMusic.cpp | 8 +++---- stepmania/src/ScreenGameplay.cpp | 18 ++++++++-------- stepmania/src/ScreenManager.cpp | 8 +++---- stepmania/src/ScreenSelectGroup.cpp | 4 ++-- stepmania/src/ScreenSelectMode.cpp | 2 +- stepmania/src/ScreenSelectMusic.cpp | 8 +++---- stepmania/src/ScrollingList.cpp | 2 +- stepmania/src/Song.cpp | 22 +++++++++---------- stepmania/src/SongManager.cpp | 16 +++++++------- stepmania/src/SongSelector.cpp | 2 +- stepmania/src/StepMania.cpp | 4 ++-- 36 files changed, 146 insertions(+), 146 deletions(-) diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 323a3b0a46..560374f504 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -16,7 +16,7 @@ void ActorFrame::AddChild( Actor* pActor) { ASSERT( pActor ); ASSERT( (void*)pActor != (void*)0xC0000005 ); - m_SubActors.Add( pActor ); + m_SubActors.push_back( pActor ); } void ActorFrame::DrawPrimitives() diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index fec78bded1..1aa72746a4 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -41,7 +41,7 @@ void BGAnimation::LoadFromStaticGraphic( CString sPath ) BGAnimationLayer* pLayer = new BGAnimationLayer; pLayer->LoadFromStaticGraphic( sPath ); - m_Layers.Add( pLayer ); + m_Layers.push_back( pLayer ); m_fFadeSeconds = 0.5f; } @@ -73,7 +73,7 @@ void BGAnimation::LoadFromAniDir( CString sAniDir, CString sSongBGPath ) continue; // don't directly load files starting with an underscore BGAnimationLayer* pLayer = new BGAnimationLayer; pLayer->LoadFromAniLayerFile( asImagePaths[i], sSongBGPath ); - m_Layers.Add( pLayer ); + m_Layers.push_back( pLayer ); } m_fFadeSeconds = 0; @@ -85,7 +85,7 @@ void BGAnimation::LoadFromMovie( CString sMoviePath, bool bLoop, bool bRewind ) BGAnimationLayer* pLayer = new BGAnimationLayer; pLayer->LoadFromMovie( sMoviePath, bLoop, bRewind ); - m_Layers.Add( pLayer ); + m_Layers.push_back( pLayer ); m_fFadeSeconds = 0.5f; } @@ -97,11 +97,11 @@ void BGAnimation::LoadFromVisualization( CString sVisPath, CString sSongBGPath ) pLayer = new BGAnimationLayer; pLayer->LoadFromStaticGraphic( sSongBGPath ); - m_Layers.Add( pLayer ); + m_Layers.push_back( pLayer ); pLayer = new BGAnimationLayer; pLayer->LoadFromVisualization( sVisPath ); - m_Layers.Add( pLayer ); + m_Layers.push_back( pLayer ); m_fFadeSeconds = 0.5f; } diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index c129902bcf..64f308a60e 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -90,7 +90,7 @@ void Background::LoadFromAniDir( CString sAniDir ) BGAnimation* pTempBGA; pTempBGA = new BGAnimation; pTempBGA->LoadFromAniDir( sAniDir ); - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); } BGAnimation *Background::GetBGA(const Song *pSong, const BackgroundChange &aniseg, const CString &bgpath) const @@ -179,13 +179,13 @@ void Background::LoadFromSong( Song* pSong ) { BGAnimation *pTempBGA = new BGAnimation; pTempBGA->LoadFromStaticGraphic( sSongBackgroundPath ); - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); } if( pSong->HasBGChanges() ) { // start off showing the static song background - m_aBGSegments.Add( BGSegment(-10000,0,false) ); + m_aBGSegments.push_back( BGSegment(-10000,0,false) ); // Load the animations used by the song's pre-defined animation plan. // the song has a plan. Use it. @@ -198,14 +198,14 @@ void Background::LoadFromSong( Song* pSong ) if(pTempBGA != NULL) { - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); // add to the plan - m_aBGSegments.Add( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.size()-1, bFade) ); + m_aBGSegments.push_back( BGSegment(aniseg.m_fStartBeat, m_BGAnimations.size()-1, bFade) ); } } // end showing the static song background - m_aBGSegments.Add( BGSegment(pSong->m_fLastBeat,0,false) ); + m_aBGSegments.push_back( BGSegment(pSong->m_fLastBeat,0,false) ); SortBGSegmentArray( m_aBGSegments ); // Need to sort in case there is a background change after the last beat (not likely) } @@ -254,7 +254,7 @@ void Background::LoadFromSong( Song* pSong ) pTempBGA = new BGAnimation; pTempBGA->LoadFromStaticGraphic( sSongBackgroundPath ); } - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); } break; case MODE_ANIMATIONS: @@ -271,7 +271,7 @@ void Background::LoadFromSong( Song* pSong ) unsigned index = rand() % arrayPossibleAnims.size(); BGAnimation *pTempBGA = new BGAnimation; pTempBGA->LoadFromAniDir( arrayPossibleAnims[index], sSongBackgroundPath ); - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); arrayPossibleAnims.erase( arrayPossibleAnims.begin()+index, arrayPossibleAnims.begin()+index+1 ); } @@ -288,7 +288,7 @@ void Background::LoadFromSong( Song* pSong ) unsigned index = rand() % arrayPossibleMovies.size(); BGAnimation *pTempBGA = new BGAnimation; pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false ); - m_BGAnimations.Add( pTempBGA ); + m_BGAnimations.push_back( pTempBGA ); arrayPossibleMovies.erase( arrayPossibleMovies.begin()+index, arrayPossibleMovies.begin()+index+1 ); } @@ -306,13 +306,13 @@ void Background::LoadFromSong( Song* pSong ) // if( backgroundMode == MODE_MOVIE_VIS ) { - m_aBGSegments.Add( BGSegment(-10000,1,false) ); + m_aBGSegments.push_back( BGSegment(-10000,1,false) ); return; } else { // start off showing the static song background - m_aBGSegments.Add( BGSegment(-10000,0,false) ); + m_aBGSegments.push_back( BGSegment(-10000,0,false) ); } const float fFirstBeat = pSong->m_fFirstBeat; @@ -322,7 +322,7 @@ void Background::LoadFromSong( Song* pSong ) * whole song. Otherwise, if it's a movie, it'll loop every four measures; we * want it to play continuously. */ if( m_BGAnimations.size() == 2) { - m_aBGSegments.Add( BGSegment(fFirstBeat,1,bFade) ); + m_aBGSegments.push_back( BGSegment(fFirstBeat,1,bFade) ); } else { // change BG every 4 bars for( float f=fFirstBeat; fm_fLastBeat,0,bFade) ); + m_aBGSegments.push_back( BGSegment(pSong->m_fLastBeat,0,bFade) ); // sort segments SortBGSegmentArray( m_aBGSegments ); diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 3c585fc244..4d90592f76 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -226,9 +226,9 @@ void Course::GetSongAndNotesForCurrentStyle( if( pNotes == NULL ) continue; // skip - apSongsOut.Add( pSong ); - apNotesOut.Add( pNotes ); - asModifiersOut.Add( sModifiers ); + apSongsOut.push_back( pSong ); + apNotesOut.push_back( pNotes ); + asModifiersOut.push_back( sModifiers ); } } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 0f9e4cbdac..7e197a75cf 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -1189,7 +1189,7 @@ void GameManager::GetGameplayStylesForGame( Game game, CArray& aSty if( editor && !g_StyleDefs[s].m_bUsedForEdit ) continue; - aStylesAddTo.Add( (Style)s ); + aStylesAddTo.push_back( (Style)s ); } } @@ -1197,7 +1197,7 @@ void GameManager::GetModesChoicesForGame( Game game, CArray& aNotesTypeAddTo ) @@ -1218,7 +1218,7 @@ void GameManager::GetNotesTypesForGame( Game game, CArray& } } if(found) - aNotesTypeAddTo.Add( (NotesType)nt ); + aNotesTypeAddTo.push_back( (NotesType)nt ); } } @@ -1332,7 +1332,7 @@ void GameManager::GetEnabledGames( CArray& aGamesOut ) CStringArray asNoteSkins; GetNoteSkinNames( game, asNoteSkins ); if( !asNoteSkins.empty() ) - aGamesOut.Add( game ); + aGamesOut.push_back( game ); } } diff --git a/stepmania/src/GroupList.cpp b/stepmania/src/GroupList.cpp index 16700c0f89..ff3cd1fe2e 100644 --- a/stepmania/src/GroupList.cpp +++ b/stepmania/src/GroupList.cpp @@ -109,7 +109,7 @@ void GroupList::Down() void GroupList::AddGroup(CString name) { - m_textLabels.Add(name); + m_textLabels.push_back(name); } void GroupList::SetSelection( unsigned sel ) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index ab555ab75a..70651c745b 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -91,18 +91,18 @@ void InputFilter::GetInputEvents( InputEventArray &array, float fDeltaTime ) iet = IET_SLOW_REPEAT; } if( int(fOldHoldTime/fTimeBetweenRepeats) != int(fNewHoldTime/fTimeBetweenRepeats) ) - array.Add( InputEvent(di,iet) ); + array.push_back( InputEvent(di,iet) ); } } else { // !IsBeingPressed(di) m_fSecsHeld[d][b] = 0; - array.Add( InputEvent(di,IET_RELEASE) ); + array.push_back( InputEvent(di,IET_RELEASE) ); } } else // !WasBeingPressed(di) { if( IsBeingPressed(di) ) - array.Add( InputEvent(di,IET_FIRST_PRESS) ); + array.push_back( InputEvent(di,IET_FIRST_PRESS) ); else // !IsBeingPressed(di) ; // don't care } diff --git a/stepmania/src/InputQueue.cpp b/stepmania/src/InputQueue.cpp index cfa4b96ed5..f7db7dc9b3 100644 --- a/stepmania/src/InputQueue.cpp +++ b/stepmania/src/InputQueue.cpp @@ -33,8 +33,8 @@ void InputQueue::RememberInput( const GameInput GameI ) /* XXX: this should be a deque, and just pop_back */ if( m_aQueue[c].size() >= MAX_INPUT_QUEUE_LENGTH ) // full m_aQueue[c].erase( m_aQueue[c].begin(), m_aQueue[c].begin() + (m_aQueue[c].size()-MAX_INPUT_QUEUE_LENGTH+1) ); - m_aQueue[c].Add( GameButtonAndTime(GameI.button,TIMER->GetTimeSinceStart()) ); -}; + m_aQueue[c].push_back( GameButtonAndTime(GameI.button,TIMER->GetTimeSinceStart()) ); +} bool InputQueue::MatchesPattern( const GameController c, const MenuButton* button_sequence, const int iNumButtons, float fMaxSecondsBack ) { diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index 4efbd6e618..ba84c15c61 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -121,9 +121,9 @@ void MenuElements::Load( CString sBackgroundPath, CString sTopEdgePath, CString void MenuElements::TweenTopLayerOnScreen() { CArray apActorsInTopFrame; - apActorsInTopFrame.Add( &m_sprTopEdge ); - apActorsInTopFrame.Add( &m_sprStyleIcon ); - apActorsInTopFrame.Add( &m_MenuTimer ); + apActorsInTopFrame.push_back( &m_sprTopEdge ); + apActorsInTopFrame.push_back( &m_sprStyleIcon ); + apActorsInTopFrame.push_back( &m_MenuTimer ); for( unsigned i=0; iGetX(); @@ -159,9 +159,9 @@ void MenuElements::TweenTopLayerOffScreen() will make each component tween off at a different rate ... -glenn CArray apActorsInTopFrame; - apActorsInTopFrame.Add( &m_sprTopEdge ); - apActorsInTopFrame.Add( &m_sprStyleIcon ); - apActorsInTopFrame.Add( &m_MenuTimer ); + apActorsInTopFrame.push_back( &m_sprTopEdge ); + apActorsInTopFrame.push_back( &m_sprStyleIcon ); + apActorsInTopFrame.push_back( &m_MenuTimer ); for( unsigned i=0; iGetX(); diff --git a/stepmania/src/MusicList.cpp b/stepmania/src/MusicList.cpp index c44cceb2ba..6599a63249 100644 --- a/stepmania/src/MusicList.cpp +++ b/stepmania/src/MusicList.cpp @@ -31,7 +31,7 @@ MusicList::MusicList() void MusicList::AddGroup() { - m_ContentsText.Add(group()); + m_ContentsText.push_back(group()); } void MusicList::AddSongsToGroup(const CArray &Songs) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 662d3d652c..f53fc4ecb0 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -449,7 +449,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps ); if( !arraySteps.empty() ) - arraySongs.Add( pSong ); + arraySongs.push_back( pSong ); } @@ -514,11 +514,11 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr { colorSection = (so==SORT_GROUP) ? SONGMAN->GetGroupColor(pSong->m_sGroupName) : SECTION_COLORS(iSectionColorIndex); iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS; - arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, sThisSection, NULL, colorSection) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_SECTION, NULL, sThisSection, NULL, colorSection) ); sLastSection = sThisSection; } - arrayWheelItemDatas.Add( WheelItemData( TYPE_SONG, pSong, sThisSection, NULL, SONGMAN->GetSongColor(pSong)) ); + arrayWheelItemDatas.push_back( WheelItemData( TYPE_SONG, pSong, sThisSection, NULL, SONGMAN->GetSongColor(pSong)) ); } } else @@ -528,7 +528,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr Song* pSong = arraySongs[i]; if( GAMESTATE->m_sPreferredGroup != "ALL MUSIC" && pSong->m_sGroupName != GAMESTATE->m_sPreferredGroup ) continue; // skip - arrayWheelItemDatas.Add( WheelItemData(TYPE_SONG, pSong, "", NULL, SONGMAN->GetSongColor(pSong)) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_SONG, pSong, "", NULL, SONGMAN->GetSongColor(pSong)) ); } } } @@ -536,7 +536,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr if( !bRoulette ) { - arrayWheelItemDatas.Add( WheelItemData(TYPE_ROULETTE, NULL, "", NULL, RageColor(1,0,0,1)) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_ROULETTE, NULL, "", NULL, RageColor(1,0,0,1)) ); } // HACK: Add extra stage item if it isn't already present on the music wheel @@ -560,7 +560,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr } if( !bFoundExtraSong ) - arrayWheelItemDatas.Add( WheelItemData(TYPE_SONG, pSong, "", NULL, GAMESTATE->GetStageColor()) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_SONG, pSong, "", NULL, GAMESTATE->GetStageColor()) ); } break; @@ -574,12 +574,12 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr { case PLAY_MODE_ONI: for( i=0; im_aOniCourses.size(); i++ ) - apCourses.Add( &SONGMAN->m_aOniCourses[i] ); + apCourses.push_back( &SONGMAN->m_aOniCourses[i] ); SortCoursePointerArrayByDifficulty( apCourses ); break; case PLAY_MODE_ENDLESS: for( i=0; im_aEndlessCourses.size(); i++ ) - apCourses.Add( &SONGMAN->m_aEndlessCourses[i] ); + apCourses.push_back( &SONGMAN->m_aEndlessCourses[i] ); break; } @@ -594,7 +594,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, false ); if( !apNotes.empty() ) - arrayWheelItemDatas.Add( WheelItemData(TYPE_COURSE, NULL, "", pCourse, pCourse->GetColor()) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_COURSE, NULL, "", pCourse, pCourse->GetColor()) ); } } break; @@ -626,7 +626,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr if( arrayWheelItemDatas.empty() ) { - arrayWheelItemDatas.Add( WheelItemData(TYPE_SECTION, NULL, "- EMPTY -", NULL, RageColor(1,0,0,1)) ); + arrayWheelItemDatas.push_back( WheelItemData(TYPE_SECTION, NULL, "- EMPTY -", NULL, RageColor(1,0,0,1)) ); } } diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 530a3434cf..82a05e1d88 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -130,7 +130,7 @@ CString NoteData::GetSMNoteDataString() iRowSpacing = int(roundf( NoteTypeToBeat(nt) * ROWS_PER_BEAT )); CStringArray asMeasureLines; - asMeasureLines.Add( ssprintf(" // measure %d", m+1) ); + asMeasureLines.push_back( ssprintf(" // measure %d", m+1) ); const int iMeasureStartRow = m * ROWS_PER_MEASURE; const int iMeasureLastRow = (m+1) * ROWS_PER_MEASURE - 1; @@ -143,12 +143,12 @@ CString NoteData::GetSMNoteDataString() for( int t=0; tConvert2sAnd3sToHoldNotes(); @@ -567,7 +567,7 @@ void NoteData::Turn( PlayerOptions::TurnType tt ) { CArray aiTracksLeftToMap; for( t=0; t aiTracksThatCouldHaveTapNotes; for( t=0; tm_NotesType != NOTES_TYPE_INVALID) - out.m_apNotes.Add( pNewNotes ); + out.m_apNotes.push_back( pNewNotes ); else delete pNewNotes; } @@ -362,7 +362,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out ) CString sNote = sNoteData.Mid(i,2); int iNote; sscanf( sNote, "%x", &iNote ); // data is in hexadecimal - arrayNotes.Add( iNote ); + arrayNotes.push_back( iNote ); } const unsigned iNumNotesInThisMeasure = arrayNotes.size(); diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index e417bb7611..90ece4d467 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -355,7 +355,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out ) *pNewNotes ); if(pNewNotes->m_NotesType != NOTES_TYPE_INVALID) - out.m_apNotes.Add( pNewNotes ); + out.m_apNotes.push_back( pNewNotes ); else delete pNewNotes; } diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index b6098ee6fb..eb05eda3ee 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -159,7 +159,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out ) { Notes* pNewNotes = new Notes; LoadFromKSFFile( out.m_sSongDir + arrayKSFFileNames[i], *pNewNotes ); - out.m_apNotes.Add( pNewNotes ); + out.m_apNotes.push_back( pNewNotes ); } CString sPath = out.m_sSongDir + arrayKSFFileNames[0]; diff --git a/stepmania/src/NotesLoaderSM.cpp b/stepmania/src/NotesLoaderSM.cpp index 5938b8c156..a84be37e45 100644 --- a/stepmania/src/NotesLoaderSM.cpp +++ b/stepmania/src/NotesLoaderSM.cpp @@ -195,7 +195,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out ) { Notes* pNewNotes = new Notes; ASSERT( pNewNotes ); - out.m_apNotes.Add( pNewNotes ); + out.m_apNotes.push_back( pNewNotes ); if( iNumParams != 7 ) { diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 80850e4938..5dd54a2b05 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -137,7 +137,7 @@ void RageDisplay::GetHzAtResolution(unsigned width, unsigned height, unsigned bp if(mode.Height != height) continue; if(GetBPP(mode.Format) != bpp) continue; - add.Add(mode.RefreshRate); + add.push_back(mode.RefreshRate); } } @@ -192,15 +192,15 @@ D3DFORMAT RageDisplay::FindBackBufferType(bool bWindowed, int iBPP) /* When windowed, add all formats; otherwise add only formats that match dwBPP. */ if( iBPP == 16 || bWindowed ) { - arrayBackBufferFormats.Add( D3DFMT_R5G6B5 ); - arrayBackBufferFormats.Add( D3DFMT_X1R5G5B5 ); - arrayBackBufferFormats.Add( D3DFMT_A1R5G5B5 ); + arrayBackBufferFormats.push_back( D3DFMT_R5G6B5 ); + arrayBackBufferFormats.push_back( D3DFMT_X1R5G5B5 ); + arrayBackBufferFormats.push_back( D3DFMT_A1R5G5B5 ); } if( iBPP == 32 || bWindowed ) { - arrayBackBufferFormats.Add( D3DFMT_R8G8B8 ); - arrayBackBufferFormats.Add( D3DFMT_X8R8G8B8 ); - arrayBackBufferFormats.Add( D3DFMT_A8R8G8B8 ); + arrayBackBufferFormats.push_back( D3DFMT_R8G8B8 ); + arrayBackBufferFormats.push_back( D3DFMT_X8R8G8B8 ); + arrayBackBufferFormats.push_back( D3DFMT_A8R8G8B8 ); } if( !bWindowed && iBPP != 16 && iBPP != 32 ) throw RageException( ssprintf("Invalid BPP '%u' specified", iBPP) ); @@ -618,7 +618,7 @@ void RageDisplay::ResetMatrixStack() void RageDisplay::PushMatrix() { - m_MatrixStack.Add( GetTopMatrix() ); + m_MatrixStack.push_back( GetTopMatrix() ); ASSERT(m_MatrixStack.size()<20); // check for infinite loop } diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index b18f8e6438..12fb204c8a 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -71,7 +71,7 @@ void RageTexture::CreateFrameRects() (j+0)/(float)m_iFramesHigh*m_iImageHeight/(float)m_iTextureHeight, (i+1)/(float)m_iFramesWide*m_iImageWidth /(float)m_iTextureWidth, (j+1)/(float)m_iFramesHigh*m_iImageHeight/(float)m_iTextureHeight ); - m_TextureCoordRects.Add( frect ); // the index of this array element will be (i + j*m_iFramesWide) + m_TextureCoordRects.push_back( frect ); // the index of this array element will be (i + j*m_iFramesWide) //LOG->Trace( "Adding frect%d %f %f %f %f", (i + j*m_iFramesWide), frect.left, frect.top, frect.right, frect.bottom ); } diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index a42c2101aa..8cd73500ca 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -127,7 +127,7 @@ void split( const CString &Source, const CString &Deliminator, CStringArray& Add if( AddCString.IsEmpty() && bIgnoreEmpty ) ; // do nothing else - AddIt.Add(AddCString); + AddIt.push_back(AddCString); startpos=pos+Deliminator.GetLength(); } while ( startpos <= Source.GetLength() ); @@ -291,9 +291,9 @@ void GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDirs, bool bRe continue; if( bReturnPathToo ) - AddTo.Add( sDir + sDirName ); + AddTo.push_back( sDir + sDirName ); else - AddTo.Add( sDirName ); + AddTo.push_back( sDirName ); } while( ::FindNextFile( hFind, &fd ) ); @@ -376,11 +376,11 @@ DirCache::CacheEntry *DirCache::LoadDirCache( const CString &sPath ) CString sExt, sThrowAway; splitrelpath( fd.cFileName, sThrowAway, sThrowAway, sExt ); - dir->files.Add(fd.cFileName); - dir->exts.Add(sExt); - dir->Attributes.Add(fd.dwFileAttributes); + dir->files.push_back(fd.cFileName); + dir->exts.push_back(sExt); + dir->Attributes.push_back(fd.dwFileAttributes); } while( ::FindNextFile( hFind, &fd ) ); - directory_cache.Add(dir); + directory_cache.push_back(dir); chdir(oldpath); return dir; @@ -455,9 +455,9 @@ bool GetExtDirListingV( const CString &sPath, CStringArray &AddTo, bool bOnlyDir if(!matched) continue; if( bReturnPathToo ) - AddTo.Add( sDir + cache->files[i] ); + AddTo.push_back( sDir + cache->files[i] ); else - AddTo.Add( cache->files[i] ); + AddTo.push_back( cache->files[i] ); } return true; diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index 0fe1374f8e..bbad90dbaa 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -57,7 +57,7 @@ bool RandomSample::LoadSound( CString sSoundFilePath ) pSS->Load( sSoundFilePath ); - m_pSamples.Add( pSS ); + m_pSamples.push_back( pSS ); return true; } diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 4b8e9adf56..99f57d65c1 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -103,7 +103,7 @@ void Screen::SendScreenMessage( ScreenMessage SM, float fDelay ) QueuedScreenMessage QSM; QSM.SM = SM; QSM.fDelayRemaining = fDelay; - m_QueuedMessages.Add( QSM ); + m_QueuedMessages.push_back( QSM ); } bool Screen::FirstUpdate() diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 2f316a7414..7757b1f7fe 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -199,7 +199,7 @@ ScreenEdit::ScreenEdit() // of the current edit. Naturally, this is where we'll // want to extract the NotesType for a (NEW) sequence. - m_pSong->m_apNotes.Add( m_pNotes ); + m_pSong->m_apNotes.push_back( m_pNotes ); GAMESTATE->m_pCurNotes[PLAYER_1] = m_pNotes; } diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index ecd0d18ed8..8549fe5d75 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -688,15 +688,15 @@ void ScreenEvaluation::TweenOnScreen() unsigned i; CArray apActorsInBonusOrStageInfo; - apActorsInBonusOrStageInfo.Add( &m_sprBonusFrame[p] ); + apActorsInBonusOrStageInfo.push_back( &m_sprBonusFrame[p] ); for( i=0; iGetX(); @@ -707,13 +707,13 @@ void ScreenEvaluation::TweenOnScreen() } CArray apActorsInGradeOrPercentFrame; - apActorsInGradeOrPercentFrame.Add( &m_sprBonusFrame[p] ); - apActorsInGradeOrPercentFrame.Add( &m_sprGradeFrame[p] ); - apActorsInGradeOrPercentFrame.Add( &m_Grades[p] ); - apActorsInGradeOrPercentFrame.Add( &m_sprPercentFrame[p] ); - apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] ); - apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] ); - apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_sprBonusFrame[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_sprGradeFrame[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_Grades[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_sprPercentFrame[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_textOniPercentLarge[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_textOniPercentSmall[p] ); + apActorsInGradeOrPercentFrame.push_back( &m_sprNewRecord[p] ); for( i=0; iGetZoomY(); diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index ece2fc4442..3f830856f8 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -261,8 +261,8 @@ void ScreenEz2SelectMusic::TweenOffScreen() CArray apActorsInScore; for( p=0; p apActorsInScore; for( int p=0; pm_apSongsPlayed.Add( GAMESTATE->m_pCurSong ); + GAMESTATE->m_apSongsPlayed.push_back( GAMESTATE->m_pCurSong ); GAMESTATE->m_iSongsIntoCourse++; for( p=0; pIsPlayerEnabled(p) ) @@ -1448,12 +1448,12 @@ void ScreenGameplay::TweenOnScreen() unsigned i, p; CArray apActorsInLifeFrame; - apActorsInLifeFrame.Add( &m_sprLifeFrame ); + apActorsInLifeFrame.push_back( &m_sprLifeFrame ); for( p=0; pGetY(); @@ -1466,15 +1466,15 @@ void ScreenGameplay::TweenOnScreen() CArray apActorsInScoreFrame; - apActorsInScoreFrame.Add( &m_sprScoreFrame ); + apActorsInScoreFrame.push_back( &m_sprScoreFrame ); for( p=0; pIsPlayerEnabled(p) ) continue; - apActorsInScoreFrame.Add( m_pScoreDisplay[p] ); - apActorsInScoreFrame.Add( &m_textPlayerOptions[p] ); + apActorsInScoreFrame.push_back( m_pScoreDisplay[p] ); + apActorsInScoreFrame.push_back( &m_textPlayerOptions[p] ); } - apActorsInScoreFrame.Add( &m_textSongOptions ); + apActorsInScoreFrame.push_back( &m_textSongOptions ); for( i=0; iGetY(); diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 331a4bdef2..e154ec4c77 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -247,7 +247,7 @@ void ScreenManager::SetNewScreen( Screen *pNewScreen ) m_ScreensToDelete.insert(m_ScreensToDelete.end(), m_ScreenStack.begin(), m_ScreenStack.end()); m_ScreenStack.clear(); - m_ScreenStack.Add( pNewScreen ); + m_ScreenStack.push_back( pNewScreen ); } void ScreenManager::SetNewScreen( CString sClassName ) @@ -274,7 +274,7 @@ void ScreenManager::Prompt( ScreenMessage SM_SendWhenDone, CString sText, bool b FlushDirCache(); // add the new state onto the back of the array - m_ScreenStack.Add( new ScreenPrompt(SM_SendWhenDone, sText, bYesNo, bDefaultAnswer, OnYes, OnNo) ); + m_ScreenStack.push_back( new ScreenPrompt(SM_SendWhenDone, sText, bYesNo, bDefaultAnswer, OnYes, OnNo) ); } void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer), void(*OnCanel)() ) @@ -282,7 +282,7 @@ void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, FlushDirCache(); // add the new state onto the back of the array - m_ScreenStack.Add( new ScreenTextEntry(SM_SendWhenDone, sQuestion, sInitialAnswer, OnOK, OnCanel) ); + m_ScreenStack.push_back( new ScreenTextEntry(SM_SendWhenDone, sQuestion, sInitialAnswer, OnOK, OnCanel) ); } void ScreenManager::PopTopScreen( ScreenMessage SM ) @@ -290,7 +290,7 @@ void ScreenManager::PopTopScreen( ScreenMessage SM ) Screen* pScreenToPop = m_ScreenStack.back(); // top menu //pScreenToPop->HandleScreenMessage( SM_LosingInputFocus ); m_ScreenStack.erase(m_ScreenStack.end()-1, m_ScreenStack.end()); - m_ScreensToDelete.Add( pScreenToPop ); + m_ScreensToDelete.push_back( pScreenToPop ); Screen* pNewTopScreen = m_ScreenStack[m_ScreenStack.size()-1]; pNewTopScreen->HandleScreenMessage( SM ); diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index ae978927d3..332f083de4 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -80,7 +80,7 @@ ScreenSelectGroup::ScreenSelectGroup() CStringArray asGroupNames; for( i=0; im_sGroupName ); + asGroupNames.push_back( aAllSongs[i]->m_sGroupName ); } /* Remove duplicate groups. */ @@ -104,7 +104,7 @@ ScreenSelectGroup::ScreenSelectGroup() if( j != 0 && aAllSongs[i]->m_sGroupName != asGroupNames[j] ) continue; - aSongsInGroup.Add( aAllSongs[i] ); + aSongsInGroup.push_back( aAllSongs[i] ); } SortSongPointerArrayByTitle( aSongsInGroup ); diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index a73f738fbf..2da0eeaa0b 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -241,7 +241,7 @@ void ScreenSelectMode::RefreshModeChoices() for( unsigned j=0; jGetPathTo("Graphics", ssprintf("select mode choice %s %s", sGameName.GetString(), choice.name) ) ); + asGraphicPaths.push_back( THEME->GetPathTo("Graphics", ssprintf("select mode choice %s %s", sGameName.GetString(), choice.name) ) ); } m_ScrollingList.Load( asGraphicPaths ); diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 851b6915a4..c491d9e497 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -335,8 +335,8 @@ void ScreenSelectMusic::TweenOffScreen() CArray apActorsInScore; for( p=0; p apActorsInScore; for( int p=0; pLoad( asGraphicPaths[i] ); - m_apSprites.Add( pNewSprite ); + m_apSprites.push_back( pNewSprite ); } } diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index a142b77383..60c1ce5d2e 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -98,21 +98,21 @@ Song::~Song() void Song::AddBPMSegment( BPMSegment seg ) { - m_BPMSegments.Add( seg ); + m_BPMSegments.push_back( seg ); SortBPMSegmentsArray( m_BPMSegments ); } void Song::AddStopSegment( StopSegment seg ) { - m_StopSegments.Add( seg ); + m_StopSegments.push_back( seg ); SortStopSegmentsArray( m_StopSegments ); } void Song::AddBackgroundChange( BackgroundChange seg ) { - m_BackgroundChanges.Add( seg ); + m_BackgroundChanges.push_back( seg ); SortBackgroundChangesArray( m_BackgroundChanges ); } @@ -572,7 +572,7 @@ void Song::GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) for( unsigned i=0; im_NotesType == nt ) - arrayAddTo.Add( m_apNotes[i] ); + arrayAddTo.push_back( m_apNotes[i] ); } } @@ -746,11 +746,11 @@ void Song::AddAutoGenNotes() // // This is way too slow. Only autogen dance->pump and pump->dance // CArray aMissingNotesTypes; -// if( !SongHasNotesType(NOTES_TYPE_DANCE_SINGLE) ) aMissingNotesTypes.Add( NOTES_TYPE_DANCE_SINGLE ); -// if( !SongHasNotesType(NOTES_TYPE_DANCE_DOUBLE) ) aMissingNotesTypes.Add( NOTES_TYPE_DANCE_DOUBLE ); -// if( !SongHasNotesType(NOTES_TYPE_DANCE_SOLO) ) aMissingNotesTypes.Add( NOTES_TYPE_DANCE_SOLO ); -// if( !SongHasNotesType(NOTES_TYPE_PUMP_SINGLE) ) aMissingNotesTypes.Add( NOTES_TYPE_PUMP_SINGLE ); -// if( !SongHasNotesType(NOTES_TYPE_PUMP_DOUBLE) ) aMissingNotesTypes.Add( NOTES_TYPE_PUMP_DOUBLE ); +// if( !SongHasNotesType(NOTES_TYPE_DANCE_SINGLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_SINGLE ); +// if( !SongHasNotesType(NOTES_TYPE_DANCE_DOUBLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_DOUBLE ); +// if( !SongHasNotesType(NOTES_TYPE_DANCE_SOLO) ) aMissingNotesTypes.push_back( NOTES_TYPE_DANCE_SOLO ); +// if( !SongHasNotesType(NOTES_TYPE_PUMP_SINGLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_PUMP_SINGLE ); +// if( !SongHasNotesType(NOTES_TYPE_PUMP_DOUBLE) ) aMissingNotesTypes.push_back( NOTES_TYPE_PUMP_DOUBLE ); // // for( unsigned i=0; im_sDescription = pOriginalNotes->m_sDescription + " (autogen)"; pNewNotes->m_NotesType = ntMissing; pNewNotes->m_sSMNoteData = pOriginalNotes->m_sSMNoteData; - this->m_apNotes.Add( pNewNotes ); + this->m_apNotes.push_back( pNewNotes ); goto next_notes_type; } @@ -824,7 +824,7 @@ next_notes_type: pOriginalNotes->GetNoteData( &originalNoteData ); newNoteData.LoadTransformedSlidingWindow( &originalNoteData, iNumTracksOfMissing ); pNewNotes->SetNoteData( &newNoteData ); - this->m_apNotes.Add( pNewNotes ); + this->m_apNotes.push_back( pNewNotes ); goto next_notes_type; } } diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 2f569feabf..c54a64daa3 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -106,8 +106,8 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName ) LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.GetString(), sBannerPath.GetString() ); } - m_arrayGroupNames.Add( sGroupDirName ); - m_GroupBannerPaths.Add(sBannerPath); + m_arrayGroupNames.push_back( sGroupDirName ); + m_GroupBannerPaths.push_back(sBannerPath); } void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() ) @@ -155,7 +155,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() ) continue; } - m_pSongs.Add( pNewSong ); + m_pSongs.push_back( pNewSong ); loaded++; } @@ -221,7 +221,7 @@ void SongManager::LoadDWISongDir( CString DWIHome ) ld.LoadFromDWIFile( ssprintf("%s\\Songs\\%s\\%s\\%s", DWIHome.GetString(), MixDirs[i].GetString(), arrayDirs[b].GetString(), sDWIFileName.GetString()), *pNewSong); - m_pSongs.Add( pNewSong ); + m_pSongs.push_back( pNewSong ); } } } @@ -416,7 +416,7 @@ void SongManager::GetSongsInGroup( const CString sGroupName, CArraym_sGroupName ) - AddTo.Add( pSong ); + AddTo.push_back( pSong ); } } @@ -453,7 +453,7 @@ void SongManager::InitCoursesFromDisk() Course course; course.LoadFromCRSFile( "Courses\\" + saCourseFiles[i], m_pSongs ); if( course.m_iStages > 0 ) - m_aOniCourses.Add( course ); + m_aOniCourses.push_back( course ); } // @@ -474,7 +474,7 @@ void SongManager::InitCoursesFromDisk() course.CreateEndlessCourseFromGroupAndDifficulty( sGroupName, dc, apGroupSongs ); if( course.m_iStages > 0 ) - m_aEndlessCourses.Add( course ); + m_aEndlessCourses.push_back( course ); } } @@ -492,7 +492,7 @@ void SongManager::InitCoursesFromDisk() Course course; course.LoadFromCRSFile( saCoursePaths[i], m_pSongs ); if( course.m_iStages > 0 ) - m_aExtraCourses.Add( course ); + m_aExtraCourses.push_back( course ); } } diff --git a/stepmania/src/SongSelector.cpp b/stepmania/src/SongSelector.cpp index 713ed77f97..f66d971836 100644 --- a/stepmania/src/SongSelector.cpp +++ b/stepmania/src/SongSelector.cpp @@ -267,7 +267,7 @@ void SongSelector::OnNotesTypeChange() m_pNotess.clear(); GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_NotesType, m_pNotess ); SortNotesArrayByDifficulty( m_pNotess ); - m_pNotess.Add( NULL ); // marker for "(NEW)" + m_pNotess.push_back( NULL ); // marker for "(NEW)" m_iSelectedNotes = 0; OnNotesChange(); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 9ef158dfca..530a84d1b1 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -158,7 +158,7 @@ void SplitCommandLine(const char *lpCmdLine, CStringArray &aCmds) { } if(cmd.GetLength()) - aCmds.Add(cmd); + aCmds.push_back(cmd); } } @@ -432,7 +432,7 @@ BOOL CALLBACK LoadingWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam if( GAMESTATE && GAMESTATE->m_sLoadingMessage != "" ) split( GAMESTATE->m_sLoadingMessage, "\n", asMessageLines, false ); else - asMessageLines.Add( "Initializing hardware..." ); + asMessageLines.push_back( "Initializing hardware..." ); SendDlgItemMessage( hWnd,