Bring shadowed variables back from the dark side.
Alright Colby, happy now?
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
|
||||
+3
-3
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -746,9 +746,9 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
|
||||
if( !change.m_sTransition.empty() )
|
||||
{
|
||||
map<RString,BackgroundTransition>::const_iterator iter = mapNameToTransition.find( change.m_sTransition );
|
||||
ASSERT( iter != mapNameToTransition.end() );
|
||||
const BackgroundTransition &bt = iter->second;
|
||||
map<RString,BackgroundTransition>::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 );
|
||||
}
|
||||
|
||||
+5
-5
@@ -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 )
|
||||
{
|
||||
|
||||
+3
-3
@@ -1093,12 +1093,12 @@ void InputMappings::ReadMappings( const InputScheme *pInputScheme, RString sFile
|
||||
vector<RString> sDeviceInputStrings;
|
||||
split( value, DEVICE_INPUT_SEPARATOR, sDeviceInputStrings, false );
|
||||
|
||||
for( unsigned i=0; i<sDeviceInputStrings.size() && i<unsigned(NUM_GAME_TO_DEVICE_SLOTS); i++ )
|
||||
for( unsigned j=0; j<sDeviceInputStrings.size() && j<unsigned(NUM_GAME_TO_DEVICE_SLOTS); j++ )
|
||||
{
|
||||
DeviceInput DeviceI;
|
||||
DeviceI.FromString( sDeviceInputStrings[i] );
|
||||
DeviceI.FromString( sDeviceInputStrings[j] );
|
||||
if( DeviceI.IsValid() )
|
||||
SetInputMap( DeviceI, GameI, i );
|
||||
SetInputMap( DeviceI, GameI, j );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,8 +250,8 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
|
||||
for( int t=0; t<out.GetNumTracks(); t++ )
|
||||
{
|
||||
NoteData::iterator begin = out.begin( t );
|
||||
NoteData::iterator end = out.end( t );
|
||||
while( begin != end )
|
||||
NoteData::iterator lEnd = out.end( t );
|
||||
while( begin != lEnd )
|
||||
{
|
||||
NoteData::iterator next = Increment( begin );
|
||||
const TapNote &tn = begin->second;
|
||||
@@ -629,12 +629,9 @@ int FindLongestOverlappingHoldNoteForAnyTrack( const NoteData &in, int iRow )
|
||||
int iMaxTailRow = -1;
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
{
|
||||
for( int t=0; t<in.GetNumTracks(); t++ )
|
||||
{
|
||||
const TapNote &tn = in.GetTapNote( t, iRow );
|
||||
if( tn.type == TapNote::hold_head )
|
||||
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
|
||||
}
|
||||
const TapNote &tn = in.GetTapNote( t, iRow );
|
||||
if( tn.type == TapNote::hold_head )
|
||||
iMaxTailRow = max( iMaxTailRow, iRow + tn.iDuration );
|
||||
}
|
||||
|
||||
return iMaxTailRow;
|
||||
|
||||
+15
-15
@@ -209,23 +209,23 @@ void NoteField::Load(
|
||||
memset( m_pDisplays, 0, sizeof(m_pDisplays) );
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
{
|
||||
RString sNoteSkinLower = GAMESTATE->m_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<RString, NoteDisplayCols *> (sNoteSkinLower, badIdea));
|
||||
m_NoteDisplays.insert(pair<RString, NoteDisplayCols *> (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; c2<m_pNoteData->GetNumTracks(); 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,8 +377,8 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector<RString> &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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) + "...";
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -106,10 +106,10 @@ void ScreenJukebox::SetSong()
|
||||
SONGMAN->GetAllCourses( apCourses, false );
|
||||
vector<const CourseEntry *> apOptions;
|
||||
vector<Course*> 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] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,8 @@ float ScreenRanking::SetPage( const PageToShow &pts )
|
||||
|
||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||
{
|
||||
StepsType st = pts.aTypes.front().second;
|
||||
// No need to shadow at this point.
|
||||
st = pts.aTypes.front().second;
|
||||
HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCategoryHighScoreList(st, pts.category);
|
||||
HighScore hs;
|
||||
bool bRecentHighScore = false;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
+5
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user