From e9df4832f6ec9de7798c2ccec02ffd3d1906ddec Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 02:54:11 -0400 Subject: [PATCH] Bring shadowed variables back from the dark side. Alright Colby, happy now? --- src/Attack.cpp | 4 ++-- src/BGAnimation.cpp | 6 +++--- src/Background.cpp | 6 +++--- src/Foreground.cpp | 10 +++++----- src/InputMapper.cpp | 6 +++--- src/NoteDataUtil.cpp | 13 +++++-------- src/NoteField.cpp | 30 +++++++++++++++--------------- src/RageFileManager.cpp | 4 ++-- src/ScreenBookkeeping.cpp | 2 +- src/ScreenGameplay.cpp | 6 +++--- src/ScreenJukebox.cpp | 14 +++++++------- src/ScreenRanking.cpp | 3 ++- src/ScreenSelectMusic.cpp | 12 ++++++------ src/SongManager.cpp | 10 +++++----- 14 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/Attack.cpp b/src/Attack.cpp index 76eab656bc..f15fdb7cae 100644 --- a/src/Attack.cpp +++ b/src/Attack.cpp @@ -34,8 +34,8 @@ void Attack::GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlay fStartBeat = min( GAMESTATE->m_fSongBeat+8, pPlayerState->m_fLastDrawnBeat ); fStartBeat = truncf(fStartBeat)+1; - const float fStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat ); - const float fEndSecond = fStartSecond + fSecsRemaining; + const float lStartSecond = pSong->GetElapsedTimeFromBeat( fStartBeat ); + const float fEndSecond = lStartSecond + fSecsRemaining; fEndBeat = pSong->GetBeatFromElapsedTime( fEndSecond ); fEndBeat = truncf(fEndBeat)+1; diff --git a/src/BGAnimation.cpp b/src/BGAnimation.cpp index dd93e73a8a..eb4fc80c4e 100644 --- a/src/BGAnimation.cpp +++ b/src/BGAnimation.cpp @@ -77,9 +77,9 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo else { // import as a single layer - BGAnimationLayer* pLayer = new BGAnimationLayer; - pLayer->LoadFromNode( pKey ); - this->AddChild( pLayer ); + BGAnimationLayer* bgLayer = new BGAnimationLayer; + bgLayer->LoadFromNode( pKey ); + this->AddChild( bgLayer ); } } } diff --git a/src/Background.cpp b/src/Background.cpp index 0d3e398506..0c4005c1a7 100644 --- a/src/Background.cpp +++ b/src/Background.cpp @@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus if( !change.m_sTransition.empty() ) { - map::const_iterator iter = mapNameToTransition.find( change.m_sTransition ); - ASSERT( iter != mapNameToTransition.end() ); - const BackgroundTransition &bt = iter->second; + map::const_iterator lIter = mapNameToTransition.find( change.m_sTransition ); + ASSERT( lIter != mapNameToTransition.end() ); + const BackgroundTransition &bt = lIter->second; m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves ); m_pFadingBGA->RunCommands( *bt.cmdRoot ); } diff --git a/src/Foreground.cpp b/src/Foreground.cpp index 84caac9025..4e75cd0b79 100644 --- a/src/Foreground.cpp +++ b/src/Foreground.cpp @@ -76,23 +76,23 @@ void Foreground::Update( float fDeltaTime ) /* Update the actor even if we're about to hide it, so queued commands * are always run. */ - float fDeltaTime; + float lDeltaTime; if( !bga.m_bga->GetVisible() ) { bga.m_bga->SetVisible( true ); const float fStartSecond = m_pSong->m_Timing.GetElapsedTimeFromBeat( bga.m_fStartBeat ); - fDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; + lDeltaTime = GAMESTATE->m_fMusicSeconds - fStartSecond; } else { - fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; + lDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; } // This shouldn't go down, but be safe: - fDeltaTime = max( fDeltaTime, 0 ); + lDeltaTime = max( lDeltaTime, 0 ); - bga.m_bga->Update( fDeltaTime / fRate ); + bga.m_bga->Update( lDeltaTime / fRate ); if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) { diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 34c82c783e..d1a40a3d76 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile vector sDeviceInputStrings; split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false ); - for( unsigned i=0; isecond; @@ -629,12 +629,9 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow ) int iMaxTailRow = -1; for( int t=0; tm_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; + RString sNoteSkinLC = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_sNoteSkin; // XXX: Re-setup sNoteSkinLower. Unsure if inserting the skin again is needed. - if (sNoteSkinLower.empty()) + if (sNoteSkinLC.empty()) { - sNoteSkinLower = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; + sNoteSkinLC = GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetPreferred().m_sNoteSkin; - if (sNoteSkinLower.empty()) + if (sNoteSkinLC.empty()) { - sNoteSkinLower = "default"; + sNoteSkinLC = "default"; } - m_NoteDisplays.insert(pair (sNoteSkinLower, badIdea)); + m_NoteDisplays.insert(pair (sNoteSkinLC, badIdea)); } - sNoteSkinLower.MakeLower(); - it = m_NoteDisplays.find( sNoteSkinLower ); - ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLower ); + sNoteSkinLC.MakeLower(); + it = m_NoteDisplays.find( sNoteSkinLC ); + ASSERT_M( it != m_NoteDisplays.end(), sNoteSkinLC ); m_pDisplays[pn] = it->second; } } @@ -1005,8 +1005,8 @@ void NoteField::DrawPrimitives() m_pNoteData->GetTapNoteRange( c, iFirstRowToDraw, iLastRowToDraw+1, begin, end ); for( ; begin != end; ++begin ) { - int i = begin->first; - const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, i); + int j = begin->first; + const TapNote &tn = begin->second; //m_pNoteData->GetTapNote(c, j); // Switch modified by Wolfman2000, tested by Saturn2888 // Fixes hold head overlapping issue, but not the rolls. @@ -1031,10 +1031,10 @@ void NoteField::DrawPrimitives() // TRICKY: If boomerang is on, then all notes in the range // [iFirstRowToDraw,iLastRowToDraw] aren't necessarily visible. // Test every note to make sure it's on screen before drawing. - if( !IsOnScreen( NoteRowToBeat(i), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) + if( !IsOnScreen( NoteRowToBeat(j), c, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels ) ) continue; // skip - ASSERT_M( NoteRowToBeat(i) > -2000, ssprintf("%i %i %i, %f %f", i, iLastRowToDraw, iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) ); + ASSERT_M( NoteRowToBeat(j) > -2000, ssprintf("%i %i %i, %f %f", j, iLastRowToDraw, iFirstRowToDraw, GAMESTATE->m_fSongBeat, GAMESTATE->m_fMusicSeconds) ); // See if there is a hold step that begins on this index. // Only do this if the noteskin cares. @@ -1043,7 +1043,7 @@ void NoteField::DrawPrimitives() { for( int c2=0; c2GetNumTracks(); c2++ ) { - if( m_pNoteData->GetTapNote(c2, i).type == TapNote::hold_head) + if( m_pNoteData->GetTapNote(c2, j).type == TapNote::hold_head) { bHoldNoteBeginsOnThisBeat = true; break; @@ -1061,7 +1061,7 @@ void NoteField::DrawPrimitives() NoteDisplayCols *displayCols = tn.pn == PLAYER_INVALID ? m_pCurDisplay : m_pDisplays[tn.pn]; displayCols->display[c].DrawTap( tn, c, NoteRowToBeat(i), bHoldNoteBeginsOnThisBeat, bUseAdditionColoring, bIsInSelectionRange ? fSelectedRangeGlow : m_fPercentFadeToFail, m_fYReverseOffsetPixels, iDrawDistanceAfterTargetsPixels, iDrawDistanceBeforeTargetsPixels, FADE_BEFORE_TARGETS_PERCENT ); - bool bNoteIsUpcoming = NoteRowToBeat(i) > GAMESTATE->m_fSongBeat; + bool bNoteIsUpcoming = NoteRowToBeat(j) > GAMESTATE->m_fSongBeat; bAnyUpcomingInThisCol |= bNoteIsUpcoming; } diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index f1fad415d4..fde2f79bdf 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add for( unsigned j = OldStart; j < AddTo.size(); ++j ) { /* Skip the trailing slash on the mountpoint; there's already a slash there. */ - RString &sPath = AddTo[j]; - sPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); + RString &lPath = AddTo[j]; + lPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); } } } diff --git a/src/ScreenBookkeeping.cpp b/src/ScreenBookkeeping.cpp index 0e379589dc..4e12142e63 100644 --- a/src/ScreenBookkeeping.cpp +++ b/src/ScreenBookkeeping.cpp @@ -165,7 +165,7 @@ void ScreenBookkeeping::UpdateView() if( iSongIndex < (int)vpSongs.size() ) { Song *pSong = vpSongs[iSongIndex]; - int iCount = pProfile->GetSongNumTimesPlayed( pSong ); + iCount = pProfile->GetSongNumTimesPlayed( pSong ); RString sTitle = ssprintf("%4d",iCount) + " " + pSong->GetDisplayFullTitle(); if( sTitle.length() > 22 ) sTitle = sTitle.Left(20) + "..."; diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 6d37d74d3a..f1f10c32d3 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -797,12 +797,12 @@ void ScreenGameplay::InitSongQueues() FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) { - Trail *pTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ]; - ASSERT( pTrail ); + Trail *lTrail = GAMESTATE->m_pCurTrail[ pi->GetStepsAndTrailIndex() ]; + ASSERT( lTrail ); pi->m_vpStepsQueue.clear(); pi->m_asModifiersQueue.clear(); - FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e ) + FOREACH_CONST( TrailEntry, lTrail->m_vEntries, e ) { ASSERT( e->pSteps ); pi->m_vpStepsQueue.push_back( e->pSteps ); diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp index 7ad7555687..c1e59aaa4d 100644 --- a/src/ScreenJukebox.cpp +++ b/src/ScreenJukebox.cpp @@ -106,10 +106,10 @@ void ScreenJukebox::SetSong() SONGMAN->GetAllCourses( apCourses, false ); vector apOptions; vector apPossibleCourses; - for( unsigned i = 0; i < apCourses.size(); ++i ) + for( unsigned j = 0; j < apCourses.size(); ++j ) { - Course *pCourse = apCourses[i]; - const CourseEntry *pEntry = pCourse->FindFixedSong( pSong ); + Course *lCourse = apCourses[j]; + const CourseEntry *pEntry = lCourse->FindFixedSong( pSong ); if( pEntry == NULL || pEntry->attacks.size() == 0 ) continue; @@ -144,14 +144,14 @@ void ScreenJukebox::SetSong() { int iIndex = RandomInt( apOptions.size() ); m_pCourseEntry = apOptions[iIndex]; - Course *pCourse = apPossibleCourses[iIndex]; + Course *lCourse = apPossibleCourses[iIndex]; - PlayMode pm = CourseTypeToPlayMode( pCourse->GetCourseType() ); + PlayMode pm = CourseTypeToPlayMode( lCourse->GetCourseType() ); GAMESTATE->m_PlayMode.Set( pm ); - GAMESTATE->m_pCurCourse.Set( pCourse ); + GAMESTATE->m_pCurCourse.Set( lCourse ); FOREACH_PlayerNumber( p ) { - GAMESTATE->m_pCurTrail[p].Set( pCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) ); + GAMESTATE->m_pCurTrail[p].Set( lCourse->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ) ); ASSERT( GAMESTATE->m_pCurTrail[p] ); } } diff --git a/src/ScreenRanking.cpp b/src/ScreenRanking.cpp index f1c2d0dbea..595e29850f 100644 --- a/src/ScreenRanking.cpp +++ b/src/ScreenRanking.cpp @@ -244,7 +244,8 @@ float ScreenRanking::SetPage( const PageToShow &pts ) for( int l=0; lGetMachineProfile()->GetCategoryHighScoreList(st, pts.category); HighScore hs; bool bRecentHighScore = false; diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index b88038f109..c0ad565963 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -1376,9 +1376,9 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input ) // Don't play start sound. We play it again below on finalized //m_soundStart.Play(); - Message msg("StepsChosen"); - msg.SetParam( "Player", p ); - MESSAGEMAN->Broadcast( msg ); + Message lMsg("StepsChosen"); + lMsg.SetParam( "Player", p ); + MESSAGEMAN->Broadcast( lMsg ); } } @@ -1781,19 +1781,19 @@ void ScreenSelectMusic::AfterMusicChange() case TYPE_COURSE: { - const Course *pCourse = m_MusicWheel.GetSelectedCourse(); + const Course *lCourse = m_MusicWheel.GetSelectedCourse(); const Style *pStyle = NULL; if( CommonMetrics::AUTO_SET_STYLE ) pStyle = pCourse->GetCourseStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined() ); if( pStyle == NULL ) pStyle = GAMESTATE->GetCurrentStyle(); - pCourse->GetTrails( m_vpTrails, pStyle->m_StepsType ); + lCourse->GetTrails( m_vpTrails, pStyle->m_StepsType ); m_sSampleMusicToPlay = m_sCourseMusicPath; m_fSampleStartSeconds = 0; m_fSampleLengthSeconds = -1; - g_sBannerPath = pCourse->GetBannerPath(); + g_sBannerPath = lCourse->GetBannerPath(); if( g_sBannerPath.empty() ) m_Banner.LoadFallback(); diff --git a/src/SongManager.cpp b/src/SongManager.cpp index 5f5376b8b7..91332d0232 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -1488,15 +1488,15 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre if( MOVE_UNLOCKS_TO_BOTTOM_OF_PREFERRED_SORT.GetValue() ) { // move all unlock songs to a group at the bottom - PreferredSortSection section; - section.sName = "Unlocks"; + PreferredSortSection PFSection; + PFSection.sName = "Unlocks"; FOREACH( UnlockEntry, UNLOCKMAN->m_UnlockEntries, ue ) { if( ue->m_Type == UnlockRewardType_Song ) { Song *pSong = ue->m_Song.ToSong(); if( pSong ) - section.vpSongs.push_back( pSong ); + PFSection.vpSongs.push_back( pSong ); } } @@ -1505,14 +1505,14 @@ void SongManager::UpdatePreferredSort(RString sPreferredSongs, RString sPreferre for( int i=v->vpSongs.size()-1; i>=0; i-- ) { Song *pSong = v->vpSongs[i]; - if( find(section.vpSongs.begin(),section.vpSongs.end(),pSong) != section.vpSongs.end() ) + if( find(PFSection.vpSongs.begin(),PFSection.vpSongs.end(),pSong) != PFSection.vpSongs.end() ) { v->vpSongs.erase( v->vpSongs.begin()+i ); } } } - m_vPreferredSongSort.push_back( section ); + m_vPreferredSongSort.push_back( PFSection ); } // prune empty groups