whitespace, commenting...

This commit is contained in:
AJ Kelly
2011-02-25 04:14:34 -06:00
parent 63352110ea
commit 4eb8117ee7
3 changed files with 28 additions and 36 deletions
+11 -17
View File
@@ -204,7 +204,7 @@ void BackgroundImpl::Init()
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
{ {
bOneOrMoreChars = true; bOneOrMoreChars = true;
// Disable dancing characters if BH will be showing. // Disable dancing characters if Beginner Helper will be showing.
if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() && if( PREFSMAN->m_bShowBeginnerHelper && BeginnerHelper::CanUse() &&
GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner ) GAMESTATE->m_pCurSteps[p] && GAMESTATE->m_pCurSteps[p]->GetDifficulty() == Difficulty_Beginner )
bShowingBeginnerHelper = true; bShowingBeginnerHelper = true;
@@ -285,10 +285,11 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
continue; continue;
} }
// Look for vsFileToResolve[i] in: /* Look for vsFileToResolve[i] in:
// - song's dir * song's dir
// - RandomMovies dir * RandomMovies dir
// - BGAnimations dir. * BGAnimations dir.
*/
vector<RString> vsPaths, vsThrowAway; vector<RString> vsPaths, vsThrowAway;
// Look for BGAnims in the song dir // Look for BGAnims in the song dir
@@ -594,12 +595,10 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
BackgroundUtil::SortBackgroundChangesArray( layer.m_aBGChanges ); BackgroundUtil::SortBackgroundChangesArray( layer.m_aBGChanges );
} }
Layer &mainlayer = m_Layer[0]; Layer &mainlayer = m_Layer[0];
/* If the first BGAnimation isn't negative, add a lead-in image showing
/* If the first BGAnimation isn't negative, add a lead-in image showing the song * the song background. */
* background. */
if( mainlayer.m_aBGChanges.empty() || mainlayer.m_aBGChanges.front().m_fStartBeat >= 0 ) if( mainlayer.m_aBGChanges.empty() || mainlayer.m_aBGChanges.front().m_fStartBeat >= 0 )
{ {
BackgroundChange change; BackgroundChange change;
@@ -636,7 +635,6 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
} }
} }
// Look for the random file marker, and replace the segment with LoadFromRandom. // Look for the random file marker, and replace the segment with LoadFromRandom.
for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ ) for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ )
{ {
@@ -659,7 +657,6 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ ) for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ )
ASSERT( !mainlayer.m_aBGChanges[i].m_def.m_sFile1.empty() ); ASSERT( !mainlayer.m_aBGChanges[i].m_def.m_sFile1.empty() );
// Re-sort. // Re-sort.
BackgroundUtil::SortBackgroundChangesArray( mainlayer.m_aBGChanges ); BackgroundUtil::SortBackgroundChangesArray( mainlayer.m_aBGChanges );
@@ -702,7 +699,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
int iThrowAway; int iThrowAway;
pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway ); pSong->m_Timing.GetBeatAndBPSFromElapsedTime( fCurrentTime, fBeat, fBPS, bFreeze, bFreeze, iThrowAway, fThrowAway );
/* Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it. */ // Calls to Update() should *not* be scaled by music rate; fCurrentTime is. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
// Find the BGSegment we're in // Find the BGSegment we're in
@@ -890,8 +887,8 @@ BrightnessOverlay::BrightnessOverlay()
void BrightnessOverlay::Update( float fDeltaTime ) void BrightnessOverlay::Update( float fDeltaTime )
{ {
ActorFrame::Update( fDeltaTime ); ActorFrame::Update( fDeltaTime );
/* If we're actually playing, then we're past fades, etc; update the background /* If we're actually playing, then we're past fades, etc; update the
* brightness to follow Cover. */ * background brightness to follow Cover. */
if( !GAMESTATE->m_bGameplayLeadIn ) if( !GAMESTATE->m_bGameplayLeadIn )
SetActualBrightness(); SetActualBrightness();
} }
@@ -939,8 +936,6 @@ void BrightnessOverlay::FadeToActualBrightness()
SetActualBrightness(); SetActualBrightness();
} }
Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); } Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); }
Background::~Background() { SAFE_DELETE( m_pImpl ); } Background::~Background() { SAFE_DELETE( m_pImpl ); }
void Background::Init() { m_pImpl->Init(); } void Background::Init() { m_pImpl->Init(); }
@@ -951,7 +946,6 @@ void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBr
DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); } DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); }
void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); } void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); }
/* /*
* (c) 2001-2004 Chris Danford, Ben Nordstrom * (c) 2001-2004 Chris Danford, Ben Nordstrom
* All rights reserved. * All rights reserved.
+5 -5
View File
@@ -25,7 +25,7 @@ void Foreground::Unload()
void Foreground::LoadFromSong( const Song *pSong ) void Foreground::LoadFromSong( const Song *pSong )
{ {
/* Song graphics can get very big; never keep them in memory. */ // Song graphics can get very big; never keep them in memory.
RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy(); RageTextureID::TexPolicy OldPolicy = TEXTUREMAN->GetDefaultTexturePolicy();
TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE ); TEXTUREMAN->SetDefaultTexturePolicy( RageTextureID::TEX_VOLATILE );
@@ -58,7 +58,7 @@ void Foreground::LoadFromSong( const Song *pSong )
void Foreground::Update( float fDeltaTime ) void Foreground::Update( float fDeltaTime )
{ {
/* Calls to Update() should *not* be scaled by music rate. Undo it. */ // Calls to Update() should *not* be scaled by music rate. Undo it.
const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate; const float fRate = GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
for( unsigned i=0; i < m_BGAnimations.size(); ++i ) for( unsigned i=0; i < m_BGAnimations.size(); ++i )
@@ -67,7 +67,7 @@ void Foreground::Update( float fDeltaTime )
if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat ) if( GAMESTATE->m_fSongBeat < bga.m_fStartBeat )
{ {
/* The animation hasn't started yet. */ // The animation hasn't started yet.
continue; continue;
} }
@@ -89,14 +89,14 @@ void Foreground::Update( float fDeltaTime )
fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds; fDeltaTime = GAMESTATE->m_fMusicSeconds - m_fLastMusicSeconds;
} }
/* This shouldn't go down, but be safe: */ // This shouldn't go down, but be safe:
fDeltaTime = max( fDeltaTime, 0 ); fDeltaTime = max( fDeltaTime, 0 );
bga.m_bga->Update( fDeltaTime / fRate ); bga.m_bga->Update( fDeltaTime / fRate );
if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat ) if( GAMESTATE->m_fSongBeat > bga.m_fStopBeat )
{ {
/* Finished. */ // Finished.
bga.m_bga->SetVisible( false ); bga.m_bga->SetVisible( false );
bga.m_bFinished = true; bga.m_bFinished = true;
continue; continue;
-2
View File
@@ -1210,13 +1210,11 @@ void ScreenGameplay::LoadNextSong()
if( m_pCombinedLifeMeter ) if( m_pCombinedLifeMeter )
m_pCombinedLifeMeter->OnLoadSong(); m_pCombinedLifeMeter->OnLoadSong();
if( m_pSongForeground ) if( m_pSongForeground )
m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong ); m_pSongForeground->LoadFromSong( GAMESTATE->m_pCurSong );
m_fTimeSinceLastDancingComment = 0; m_fTimeSinceLastDancingComment = 0;
/* m_soundMusic and m_pSongBackground take a very long time to load, /* m_soundMusic and m_pSongBackground take a very long time to load,
* so cap fDelta at 0 so m_NextSong will show up on screen. * so cap fDelta at 0 so m_NextSong will show up on screen.
* -Chris */ * -Chris */