diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index 5afaed85a1..1b7aed4e4f 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -33,11 +33,11 @@ void AnnouncerManager::GetAnnouncerNames( CStringArray& AddTo ) // strip out the folder called "CVS" and EMPTY_ANNOUNCER_NAME for( int i=AddTo.size()-1; i>=0; i-- ) if( !stricmp( AddTo[i], "cvs" ) ) - AddTo.RemoveAt(i); + AddTo.erase(AddTo.begin()+i, AddTo.begin()+i+1 ); for( int i=AddTo.size()-1; i>=0; i-- ) if( !stricmp( AddTo[i], EMPTY_ANNOUNCER_NAME ) ) - AddTo.RemoveAt(i); + AddTo.erase(AddTo.begin()+i, AddTo.begin()+i+1 ); } bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index bacd85902f..c129902bcf 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -264,14 +264,16 @@ void Background::LoadFromSong( Song* pSong ) // strip out "cvs" and "danger 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); + arrayPossibleAnims.erase(arrayPossibleAnims.begin()+i, + arrayPossibleAnims.begin()+i+1); for( i=0; i<4 && !arrayPossibleAnims.empty(); i++ ) { unsigned index = rand() % arrayPossibleAnims.size(); BGAnimation *pTempBGA = new BGAnimation; pTempBGA->LoadFromAniDir( arrayPossibleAnims[index], sSongBackgroundPath ); m_BGAnimations.Add( pTempBGA ); - arrayPossibleAnims.RemoveAt( index ); + arrayPossibleAnims.erase( arrayPossibleAnims.begin()+index, + arrayPossibleAnims.begin()+index+1 ); } } break; @@ -287,7 +289,8 @@ void Background::LoadFromSong( Song* pSong ) BGAnimation *pTempBGA = new BGAnimation; pTempBGA->LoadFromMovie( arrayPossibleMovies[index], true, false ); m_BGAnimations.Add( pTempBGA ); - arrayPossibleMovies.RemoveAt( index ); + arrayPossibleMovies.erase( arrayPossibleMovies.begin()+index, + arrayPossibleMovies.begin()+index+1 ); } } break; diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index a606e2c3f6..0f9e4cbdac 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -1346,7 +1346,7 @@ void GameManager::GetNoteSkinNames( Game game, CStringArray &AddTo ) const // strip out "CVS" for( int i=AddTo.size()-1; i>=0; i-- ) if( 0 == stricmp("cvs", AddTo[i]) ) - AddTo.RemoveAt( i ); + AddTo.erase( AddTo.begin()+i, AddTo.begin()+i+1 ); } void GameManager::GetNoteSkinNames( CStringArray &AddTo ) const diff --git a/stepmania/src/InputQueue.cpp b/stepmania/src/InputQueue.cpp index 58f2393441..cfa4b96ed5 100644 --- a/stepmania/src/InputQueue.cpp +++ b/stepmania/src/InputQueue.cpp @@ -30,8 +30,9 @@ InputQueue::InputQueue() void InputQueue::RememberInput( const GameInput GameI ) { int c = GameI.controller; + /* XXX: this should be a deque, and just pop_back */ if( m_aQueue[c].size() >= MAX_INPUT_QUEUE_LENGTH ) // full - m_aQueue[c].RemoveAt( 0, m_aQueue[c].size()-MAX_INPUT_QUEUE_LENGTH+1 ); + 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()) ); }; diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index aefaefd1fe..530a3434cf 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -573,7 +573,8 @@ void NoteData::Turn( PlayerOptions::TurnType tt ) { int iRandTrackIndex = rand()%aiTracksLeftToMap.size(); int iRandTrack = aiTracksLeftToMap[iRandTrackIndex]; - aiTracksLeftToMap.RemoveAt( iRandTrackIndex ); + aiTracksLeftToMap.erase( aiTracksLeftToMap.begin()+iRandTrackIndex, + aiTracksLeftToMap.begin()+iRandTrackIndex+1 ); iTakeFromTrack[t] = iRandTrack; } } @@ -634,7 +635,8 @@ void NoteData::Turn( PlayerOptions::TurnType tt ) { int iRandIndex = rand() % aiTracksThatCouldHaveTapNotes.size(); int iTo = aiTracksThatCouldHaveTapNotes[ iRandIndex ]; - aiTracksThatCouldHaveTapNotes.RemoveAt( iRandIndex ); + aiTracksThatCouldHaveTapNotes.erase( aiTracksThatCouldHaveTapNotes.begin()+iRandIndex, + aiTracksThatCouldHaveTapNotes.begin()+iRandIndex+1 ); tempNoteData.SetTapNote(iTo, r, GetTapNote(t, r)); } diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index 59f0c514d4..b6098ee6fb 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -190,7 +190,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out ) !stricmp(asBits[2], "hard") || !stricmp(asBits[2], "crazy")) ) { - asBits.RemoveAt(2); + asBits.erase(asBits.begin()+2, asBits.begin()+3); } if( asBits.size() == 2 ) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 4afe7d11d9..80850e4938 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -624,7 +624,7 @@ void RageDisplay::PushMatrix() void RageDisplay::PopMatrix() { - m_MatrixStack.RemoveAt( m_MatrixStack.size()-1 ); + m_MatrixStack.erase( m_MatrixStack.end()-1, m_MatrixStack.end() ); } void RageDisplay::Translate( float x, float y, float z ) diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index aa4aa1ca59..4b8e9adf56 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -48,7 +48,8 @@ void Screen::Update( float fDeltaTime ) if( m_QueuedMessages[i].fDelayRemaining <= 0.0f ) // send this sucker! { this->HandleScreenMessage( m_QueuedMessages[i].SM ); - m_QueuedMessages.RemoveAt( i ); + m_QueuedMessages.erase( m_QueuedMessages.begin()+i, + m_QueuedMessages.begin()+i+1 ); i--; } else diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 32160300a0..2f316a7414 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -625,7 +625,8 @@ void AddBGChange( CString sBGName ) } if( i != pSong->m_BackgroundChanges.size() ) // there is already a BGChange here - pSong->m_BackgroundChanges.RemoveAt( i ); + pSong->m_BackgroundChanges.erase( pSong->m_BackgroundChanges.begin()+i, + pSong->m_BackgroundChanges.begin()+i+1); // create a new BGChange if( sBGName != "" ) @@ -1094,7 +1095,8 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ else // BPMSegment being modified is m_BPMSegments[i] { if( i > 0 && fabsf(m_pSong->m_BPMSegments[i-1].m_fBPM - fNewBPM) < 0.025f ) - m_pSong->m_BPMSegments.RemoveAt( i ); + m_pSong->m_BPMSegments.erase( m_pSong->m_BPMSegments.begin()+i, + m_pSong->m_BPMSegments.begin()+i+1); else m_pSong->m_BPMSegments[i].m_fBPM = fNewBPM; } @@ -1133,7 +1135,8 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ { m_pSong->m_StopSegments[i].m_fStopSeconds += fStopDelta; if( m_pSong->m_StopSegments[i].m_fStopSeconds <= 0 ) - m_pSong->m_StopSegments.RemoveAt( i ); + m_pSong->m_StopSegments.erase( m_pSong->m_StopSegments.begin()+i, + m_pSong->m_StopSegments.begin()+i+1); } } break; diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index d70522a69e..ecd0d18ed8 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -218,7 +218,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) for( int p=0; pm_apSongsPlayed.size() > STAGES_TO_SHOW_IN_SUMMARY ) - GAMESTATE->m_apSongsPlayed.RemoveAt( 0, GAMESTATE->m_apSongsPlayed.size() - STAGES_TO_SHOW_IN_SUMMARY ); + GAMESTATE->m_apSongsPlayed.erase( GAMESTATE->m_apSongsPlayed.begin(), GAMESTATE->m_apSongsPlayed.begin() + (GAMESTATE->m_apSongsPlayed.size() - STAGES_TO_SHOW_IN_SUMMARY) ); } const unsigned iSongsToShow = GAMESTATE->m_apSongsPlayed.size(); diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 797e25bd0c..331a4bdef2 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -289,7 +289,7 @@ void ScreenManager::PopTopScreen( ScreenMessage SM ) { Screen* pScreenToPop = m_ScreenStack.back(); // top menu //pScreenToPop->HandleScreenMessage( SM_LosingInputFocus ); - m_ScreenStack.RemoveAt(m_ScreenStack.size()-1); + m_ScreenStack.erase(m_ScreenStack.end()-1, m_ScreenStack.end()); m_ScreensToDelete.Add( pScreenToPop ); Screen* pNewTopScreen = m_ScreenStack[m_ScreenStack.size()-1]; diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 831503b10b..ae978927d3 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -75,7 +75,7 @@ ScreenSelectGroup::ScreenSelectGroup() aAllSongs[j]->NormallyDisplayed() ) continue; - aAllSongs.RemoveAt( j ); + aAllSongs.erase( aAllSongs.begin()+j, aAllSongs.begin()+j+1 ); } CStringArray asGroupNames; @@ -87,7 +87,8 @@ ScreenSelectGroup::ScreenSelectGroup() SortCStringArray(asGroupNames, true); for( i=asGroupNames.size()-1; i > 0; --i ) { if( asGroupNames[i] == asGroupNames[i-1] ) - asGroupNames.RemoveAt( i ); + asGroupNames.erase( asGroupNames.begin()+i, + asGroupNames.begin()+i+1 ); } asGroupNames.insert(asGroupNames.begin(), "ALL MUSIC" ); diff --git a/stepmania/src/ScreenSelectMode.cpp b/stepmania/src/ScreenSelectMode.cpp index 3d8d49eeb8..a73f738fbf 100644 --- a/stepmania/src/ScreenSelectMode.cpp +++ b/stepmania/src/ScreenSelectMode.cpp @@ -232,7 +232,8 @@ void ScreenSelectMode::RefreshModeChoices() // remove ModeChoices that won't work with the current number of players for( i=m_aPossibleModeChoices.size()-1; i>=0; i-- ) if( m_aPossibleModeChoices[i].numSidesJoinedToPlay != iNumSidesJoined ) - m_aPossibleModeChoices.RemoveAt( i ); + m_aPossibleModeChoices.erase( m_aPossibleModeChoices.begin()+i, + m_aPossibleModeChoices.begin()+i+1 ); CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName; diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index d4c7e9a02a..36e7d247fb 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -52,9 +52,13 @@ void ThemeManager::GetAllThemeNames( CStringArray& AddTo ) GetDirListing( THEMES_DIR+"\\*", AddTo, true ); // strip out the folder called "CVS" - for( int i=AddTo.size()-1; i >= 0; i-- ) - if( 0 == stricmp(AddTo[i],"cvs") ) - AddTo.RemoveAt(i); + for( CStringArray::iterator i=AddTo.begin(); i != AddTo.end(); ++i ) + { + if( !stricmp(*i,"cvs") ) { + AddTo.erase(i, i+1); + break; + } + } } void ThemeManager::GetThemeNamesForCurGame( CStringArray& AddTo )