diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 9e0caa49cb..aa4aa1ca59 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -41,7 +41,7 @@ void Screen::Update( float fDeltaTime ) // update the times of queued ScreenMessages and send if timer has expired // The order you remove messages in must be very careful! Sending a message can // potentially clear all m_QueuedMessages, and set a new state! - for( int i=0; iGetAnnouncerNames( arrayAnnouncerNames ); - m_OptionRowData[AO_ANNOUNCER].iNumOptions = arrayAnnouncerNames.GetSize() + 1; - - for( int i=0; iGetThemeNamesForCurGame( arrayThemeNames ); - m_OptionRowData[AO_THEME].iNumOptions = arrayThemeNames.GetSize(); + m_OptionRowData[AO_THEME].iNumOptions = arrayThemeNames.size(); - for( i=0; iGetNoteSkinNames( arraySkinNames ); - m_OptionRowData[AO_SKIN].iNumOptions = arraySkinNames.GetSize(); + m_OptionRowData[AO_SKIN].iNumOptions = arraySkinNames.size(); - for( i=0; im_pCurSong; - - for( int i=0; im_BackgroundChanges.GetSize(); i++ ) + unsigned i; + for( i=0; im_BackgroundChanges.size(); i++ ) { if( pSong->m_BackgroundChanges[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) break; } - if( i != pSong->m_BackgroundChanges.GetSize() ) // there is already a BGChange here + if( i != pSong->m_BackgroundChanges.size() ) // there is already a BGChange here pSong->m_BackgroundChanges.RemoveAt( i ); // create a new BGChange @@ -1043,12 +1043,13 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ case DIK_B: { CString sOldBackground; - for( int i=0; im_BackgroundChanges.GetSize(); i++ ) + unsigned i; + for( i=0; im_BackgroundChanges.size(); i++ ) { if( m_pSong->m_BackgroundChanges[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) break; } - if( i != m_pSong->m_BackgroundChanges.GetSize() ) // there is already a BGChange here + if( i != m_pSong->m_BackgroundChanges.size() ) // there is already a BGChange here sOldBackground = m_pSong->m_BackgroundChanges[i].m_sBGName; SCREENMAN->TextEntry( SM_None, "Type a background name.\nPress Enter to keep,\nEscape to cancel.\nEnter an empty string to remove\nthe Background Change.", sOldBackground, AddBGChange, NULL ); @@ -1080,11 +1081,12 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ } float fNewBPM = fBPM + fDeltaBPM; - for( int i=0; im_BPMSegments.GetSize(); i++ ) + unsigned i; + for( i=0; im_BPMSegments.size(); i++ ) if( m_pSong->m_BPMSegments[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) break; - if( i == m_pSong->m_BPMSegments.GetSize() ) // there is no BPMSegment at the current beat + if( i == m_pSong->m_BPMSegments.size() ) // there is no BPMSegment at the current beat { // create a new BPMSegment m_pSong->AddBPMSegment( BPMSegment(GAMESTATE->m_fSongBeat, fNewBPM) ); @@ -1114,13 +1116,14 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ case IET_FAST_REPEAT: fStopDelta *= 40; break; } - for( int i=0; im_StopSegments.GetSize(); i++ ) + unsigned i; + for( i=0; im_StopSegments.size(); i++ ) { if( m_pSong->m_StopSegments[i].m_fStartBeat == GAMESTATE->m_fSongBeat ) break; } - if( i == m_pSong->m_StopSegments.GetSize() ) // there is no BPMSegment at the current beat + if( i == m_pSong->m_StopSegments.size() ) // there is no BPMSegment at the current beat { // create a new StopSegment if( fStopDelta > 0 ) diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index 7b82609d03..2434df3289 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -217,11 +217,11 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) // crop down to 3 for( int p=0; pm_apSongsPlayed.GetSize() > STAGES_TO_SHOW_IN_SUMMARY ) - GAMESTATE->m_apSongsPlayed.RemoveAt( 0, GAMESTATE->m_apSongsPlayed.GetSize() - STAGES_TO_SHOW_IN_SUMMARY ); + if( GAMESTATE->m_apSongsPlayed.size() > STAGES_TO_SHOW_IN_SUMMARY ) + GAMESTATE->m_apSongsPlayed.RemoveAt( 0, GAMESTATE->m_apSongsPlayed.size() - STAGES_TO_SHOW_IN_SUMMARY ); } - const int iSongsToShow = GAMESTATE->m_apSongsPlayed.GetSize(); + const unsigned iSongsToShow = GAMESTATE->m_apSongsPlayed.size(); ASSERT( iSongsToShow > 0 ); for( int i=0; i apActorsInBonusOrStageInfo; apActorsInBonusOrStageInfo.Add( &m_sprBonusFrame[p] ); @@ -697,7 +697,7 @@ void ScreenEvaluation::TweenOnScreen() apActorsInBonusOrStageInfo.Add( &m_sprCourseFrame[p] ); apActorsInBonusOrStageInfo.Add( &m_textTime[p] ); apActorsInBonusOrStageInfo.Add( &m_textSongsSurvived[p] ); - for( i=0; iGetX(); apActorsInBonusOrStageInfo[i]->SetX( fOriginalX + SCREEN_WIDTH/2*(p==PLAYER_1 ? 1 : -1) ); @@ -714,7 +714,7 @@ void ScreenEvaluation::TweenOnScreen() apActorsInGradeOrPercentFrame.Add( &m_textOniPercentLarge[p] ); apActorsInGradeOrPercentFrame.Add( &m_textOniPercentSmall[p] ); apActorsInGradeOrPercentFrame.Add( &m_sprNewRecord[p] ); - for( i=0; iGetZoomY(); apActorsInGradeOrPercentFrame[i]->SetZoomY( 0 ); diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index 308011ad5d..ece2fc4442 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -264,7 +264,7 @@ void ScreenEz2SelectMusic::TweenOffScreen() apActorsInScore.Add( &m_sprHighScoreFrame[p] ); apActorsInScore.Add( &m_HighScore[p] ); } - for( i=0; iBeginTweening( TWEEN_TIME, TWEEN_BIAS_END ); apActorsInScore[i]->SetTweenX( SCORE_CONNECTED_TO_MUSIC_WHEEL ? apActorsInScore[i]->GetX()+400 : apActorsInScore[i]->GetX()-400 ); @@ -284,7 +284,7 @@ void ScreenEz2SelectMusic::TweenScoreOnAndOffAfterChangeSort() apActorsInScore.Add( &m_sprHighScoreFrame[p] ); apActorsInScore.Add( &m_HighScore[p] ); } - for( int i=0; iStopTweening(); @@ -376,7 +376,7 @@ void ScreenEz2SelectMusic::EasierDifficulty( PlayerNumber pn ) if( !GAMESTATE->IsPlayerEnabled(pn) ) return; - if( m_arrayNotes.GetSize() == 0 ) + if( m_arrayNotes.empty() ) return; if( m_iSelection[pn] == 0 ) return; @@ -396,9 +396,9 @@ void ScreenEz2SelectMusic::HarderDifficulty( PlayerNumber pn ) if( !GAMESTATE->IsPlayerEnabled(pn) ) return; - if( m_arrayNotes.GetSize() == 0 ) + if( m_arrayNotes.empty() ) return; - if( m_iSelection[pn] == m_arrayNotes.GetSize()-1 ) + if( m_iSelection[pn] == m_arrayNotes.size()-1 ) return; m_iSelection[pn]++; @@ -599,9 +599,9 @@ void ScreenEz2SelectMusic::AfterNotesChange( PlayerNumber pn ) if( !GAMESTATE->IsPlayerEnabled(pn) ) return; - m_iSelection[pn] = clamp( m_iSelection[pn], 0, m_arrayNotes.GetSize()-1 ); // bounds clamping + m_iSelection[pn] = clamp( m_iSelection[pn], 0, m_arrayNotes.size()-1 ); // bounds clamping - Notes* pNotes = m_arrayNotes.GetSize()>0 ? m_arrayNotes[m_iSelection[pn]] : NULL; + Notes* pNotes = m_arrayNotes.empty()? NULL:m_arrayNotes[m_iSelection[pn]]; GAMESTATE->m_pCurNotes[pn] = pNotes; @@ -670,11 +670,11 @@ void ScreenEz2SelectMusic::AfterMusicChange() { if( !GAMESTATE->IsPlayerEnabled( PlayerNumber(p) ) ) continue; - for( int i=0; im_DifficultyClass == GAMESTATE->m_PreferredDifficultyClass[p] ) m_iSelection[p] = i; - m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes.GetSize() ) ; + m_iSelection[p] = clamp( m_iSelection[p], 0, m_arrayNotes.size() ) ; } } break; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d423ded70e..fb9f205805 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -140,7 +140,7 @@ ScreenGameplay::ScreenGameplay() CStringArray asModifiers; pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); - for( int i=0; iGetNoteData( ¬edata ); int iPossibleDancePoints = notedata.GetPossibleDancePoints(); @@ -497,7 +497,7 @@ bool ScreenGameplay::IsLastSong() CStringArray asModifiers; pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); - return GAMESTATE->m_iSongsIntoCourse >= apSongs.GetSize(); // there are no more songs left + return unsigned(GAMESTATE->m_iSongsIntoCourse) >= apSongs.size(); // there are no more songs left } break; default: @@ -528,7 +528,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad ) pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes, asModifiers, true ); int iPlaySongIndex = GAMESTATE->m_iSongsIntoCourse; - iPlaySongIndex %= apSongs.GetSize(); + iPlaySongIndex %= apSongs.size(); GAMESTATE->m_pCurSong = apSongs[iPlaySongIndex]; for( p=0; p apActorsInLifeFrame; apActorsInLifeFrame.Add( &m_sprLifeFrame ); @@ -1454,7 +1454,7 @@ void ScreenGameplay::TweenOnScreen() apActorsInLifeFrame.Add( &m_textStageNumber ); for( p=0; pGetY(); apActorsInLifeFrame[i]->SetY( fOriginalY-100 ); @@ -1475,7 +1475,7 @@ void ScreenGameplay::TweenOnScreen() apActorsInScoreFrame.Add( &m_textPlayerOptions[p] ); } apActorsInScoreFrame.Add( &m_textSongOptions ); - for( i=0; iGetY(); apActorsInScoreFrame[i]->SetY( fOriginalY+100 ); diff --git a/stepmania/src/ScreenGraphicOptions.cpp b/stepmania/src/ScreenGraphicOptions.cpp index e23c70a9ba..cf248ff5f4 100644 --- a/stepmania/src/ScreenGraphicOptions.cpp +++ b/stepmania/src/ScreenGraphicOptions.cpp @@ -114,11 +114,11 @@ void ScreenGraphicOptions::UpdateRefreshRates() opt.iNumOptions = 2; int OldSettingNo = RageDisplay::REFRESH_DEFAULT; - int i; + unsigned i; for(i = 2; i < MAX_OPTIONS_PER_LINE; ++i) opt.szOptionsText[i][0] = 0; - for(i = 0; i < hz.GetSize(); ++i) + for(i = 0; i < hz.size(); ++i) { if(hz[i] < 60) continue; sprintf(opt.szOptionsText[opt.iNumOptions], "%i", hz[i]); diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 17435ac58b..797e25bd0c 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -62,7 +62,7 @@ ScreenManager::~ScreenManager() EmptyDeleteQueue(); // delete current states - for( int i=0; iRestore(); } void ScreenManager::Invalidate() { - for( int i=0; iInvalidate(); } void ScreenManager::Draw() { // Draw all CurrentScreens (back to front) - for( int i=0; iDraw(); if( m_textSystemMessage.GetDiffuse().a != 0 ) @@ -148,8 +148,8 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type // DeviceI.device, DeviceI.button, GameI.controller, GameI.button, MenuI.player, MenuI.button, StyleI.player, StyleI.col ); // pass input only to topmost state - if( m_ScreenStack.GetSize() > 0 ) - m_ScreenStack[m_ScreenStack.GetSize()-1]->Input( DeviceI, type, GameI, MenuI, StyleI ); + if( !m_ScreenStack.empty() ) + m_ScreenStack.back()->Input( DeviceI, type, GameI, MenuI, StyleI ); } @@ -287,18 +287,18 @@ void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, void ScreenManager::PopTopScreen( ScreenMessage SM ) { - Screen* pScreenToPop = m_ScreenStack[m_ScreenStack.GetSize()-1]; // top menu + Screen* pScreenToPop = m_ScreenStack.back(); // top menu //pScreenToPop->HandleScreenMessage( SM_LosingInputFocus ); - m_ScreenStack.RemoveAt(m_ScreenStack.GetSize()-1); + m_ScreenStack.RemoveAt(m_ScreenStack.size()-1); m_ScreensToDelete.Add( pScreenToPop ); - Screen* pNewTopScreen = m_ScreenStack[m_ScreenStack.GetSize()-1]; + Screen* pNewTopScreen = m_ScreenStack[m_ScreenStack.size()-1]; pNewTopScreen->HandleScreenMessage( SM ); } void ScreenManager::SendMessageToTopScreen( ScreenMessage SM, float fDelay ) { - Screen* pTopScreen = m_ScreenStack[m_ScreenStack.GetSize()-1]; + Screen* pTopScreen = m_ScreenStack.back(); pTopScreen->SendScreenMessage( SM, fDelay ); }