Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
This commit is contained in:
committed by
Martin Natano
parent
f0680a29fc
commit
0cba3579de
+27
-27
@@ -86,14 +86,14 @@ public:
|
||||
|
||||
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
|
||||
|
||||
void GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] );
|
||||
void GetLoadedBackgroundChanges( std::vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] );
|
||||
|
||||
protected:
|
||||
bool m_bInitted;
|
||||
DancingCharacters* m_pDancingCharacters;
|
||||
const Song *m_pSong;
|
||||
map<RString,BackgroundTransition> m_mapNameToTransition;
|
||||
deque<BackgroundDef> m_RandomBGAnimations; // random background to choose from. These may or may not be loaded into m_BGAnimations.
|
||||
std::map<RString,BackgroundTransition> m_mapNameToTransition;
|
||||
std::deque<BackgroundDef> m_RandomBGAnimations; // random background to choose from. These may or may not be loaded into m_BGAnimations.
|
||||
|
||||
void LoadFromRandom( float fFirstBeat, float fEndBeat, const BackgroundChange &change );
|
||||
bool IsDangerAllVisible();
|
||||
@@ -107,13 +107,13 @@ protected:
|
||||
// return true if created and added to m_BGAnimations
|
||||
bool CreateBackground( const Song *pSong, const BackgroundDef &bd, Actor *pParent );
|
||||
// return def of the background that was created and added to m_BGAnimations. calls CreateBackground
|
||||
BackgroundDef CreateRandomBGA( const Song *pSong, const RString &sEffect, deque<BackgroundDef> &RandomBGAnimations, Actor *pParent );
|
||||
BackgroundDef CreateRandomBGA( const Song *pSong, const RString &sEffect, std::deque<BackgroundDef> &RandomBGAnimations, Actor *pParent );
|
||||
|
||||
int FindBGSegmentForBeat( float fBeat ) const;
|
||||
void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map<RString,BackgroundTransition> &mapNameToTransition );
|
||||
void UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const std::map<RString,BackgroundTransition> &mapNameToTransition );
|
||||
|
||||
map<BackgroundDef,Actor*> m_BGAnimations;
|
||||
vector<BackgroundChange> m_aBGChanges;
|
||||
std::map<BackgroundDef,Actor*> m_BGAnimations;
|
||||
std::vector<BackgroundChange> m_aBGChanges;
|
||||
int m_iCurBGChangeIndex;
|
||||
Actor *m_pCurrentBGA;
|
||||
Actor *m_pFadingBGA;
|
||||
@@ -179,7 +179,7 @@ void BackgroundImpl::Init()
|
||||
// load transitions
|
||||
{
|
||||
ASSERT( m_mapNameToTransition.empty() );
|
||||
vector<RString> vsPaths, vsNames;
|
||||
std::vector<RString> vsPaths, vsNames;
|
||||
BackgroundUtil::GetBackgroundTransitions( "", vsPaths, vsNames );
|
||||
for( unsigned i=0; i<vsPaths.size(); i++ )
|
||||
{
|
||||
@@ -268,13 +268,13 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
ASSERT( m_BGAnimations.find(bd) == m_BGAnimations.end() );
|
||||
|
||||
// Resolve the background names
|
||||
vector<RString> vsToResolve;
|
||||
std::vector<RString> vsToResolve;
|
||||
vsToResolve.push_back( bd.m_sFile1 );
|
||||
vsToResolve.push_back( bd.m_sFile2 );
|
||||
|
||||
vector<RString> vsResolved;
|
||||
std::vector<RString> vsResolved;
|
||||
vsResolved.resize( vsToResolve.size() );
|
||||
vector<LuaThreadVariable *> vsResolvedRef;
|
||||
std::vector<LuaThreadVariable *> vsResolvedRef;
|
||||
vsResolvedRef.resize( vsToResolve.size() );
|
||||
|
||||
for( unsigned i=0; i<vsToResolve.size(); i++ )
|
||||
@@ -294,7 +294,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
* RandomMovies dir
|
||||
* BGAnimations dir.
|
||||
*/
|
||||
vector<RString> vsPaths, vsThrowAway;
|
||||
std::vector<RString> vsPaths, vsThrowAway;
|
||||
|
||||
// Look for BGAnims in the song dir
|
||||
if( sToResolve == SONG_BACKGROUND_FILE )
|
||||
@@ -364,7 +364,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
RString sEffectFile;
|
||||
for( int i=0; i<2; i++ )
|
||||
{
|
||||
vector<RString> vsPaths, vsThrowAway;
|
||||
std::vector<RString> vsPaths, vsThrowAway;
|
||||
BackgroundUtil::GetBackgroundEffects( sEffect, vsPaths, vsThrowAway );
|
||||
if( vsPaths.empty() )
|
||||
{
|
||||
@@ -396,7 +396,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
return true;
|
||||
}
|
||||
|
||||
BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, deque<BackgroundDef> &RandomBGAnimations, Actor *pParent )
|
||||
BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const RString &sEffect, std::deque<BackgroundDef> &RandomBGAnimations, Actor *pParent )
|
||||
{
|
||||
if( g_RandomBackgroundMode == BGMODE_OFF )
|
||||
return BackgroundDef();
|
||||
@@ -417,7 +417,7 @@ BackgroundDef BackgroundImpl::Layer::CreateRandomBGA( const Song *pSong, const R
|
||||
if( !sEffect.empty() )
|
||||
bd.m_sEffect = sEffect;
|
||||
|
||||
map<BackgroundDef,Actor*>::const_iterator iter = m_BGAnimations.find( bd );
|
||||
std::map<BackgroundDef,Actor*>::const_iterator iter = m_BGAnimations.find( bd );
|
||||
|
||||
// create the background if it's not already created
|
||||
if( iter == m_BGAnimations.end() )
|
||||
@@ -436,7 +436,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
const TimingData &timing = m_pSong->m_SongTiming;
|
||||
|
||||
// change BG every time signature change or 4 measures
|
||||
const vector<TimingSegment *> &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG);
|
||||
const std::vector<TimingSegment *> &tSigs = timing.GetTimingSegments(SEGMENT_TIME_SIG);
|
||||
|
||||
for (unsigned i = 0; i < tSigs.size(); i++)
|
||||
{
|
||||
@@ -444,9 +444,9 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
int iSegmentEndRow = (i + 1 == tSigs.size()) ? iEndRow : tSigs[i+1]->GetRow();
|
||||
|
||||
|
||||
int time_signature_start= max(ts->GetRow(),iStartRow);
|
||||
int time_signature_start= std::max(ts->GetRow(),iStartRow);
|
||||
for(int j= time_signature_start;
|
||||
j<min(iEndRow,iSegmentEndRow);
|
||||
j<std::min(iEndRow,iSegmentEndRow);
|
||||
j+= int(RAND_BG_CHANGE_MEASURES * ts->GetNoteRowsPerMeasure()))
|
||||
{
|
||||
// Don't fade. It causes frame rate dip, especially on slower machines.
|
||||
@@ -473,7 +473,7 @@ void BackgroundImpl::LoadFromRandom( float fFirstBeat, float fEndBeat, const Bac
|
||||
if(RAND_BG_CHANGES_WHEN_BPM_CHANGES)
|
||||
{
|
||||
// change BG every BPM change that is at the beginning of a measure
|
||||
const vector<TimingSegment *> &bpms = timing.GetTimingSegments(SEGMENT_BPM);
|
||||
const std::vector<TimingSegment *> &bpms = timing.GetTimingSegments(SEGMENT_BPM);
|
||||
for( unsigned i=0; i<bpms.size(); i++ )
|
||||
{
|
||||
bool bAtBeginningOfMeasure = false;
|
||||
@@ -520,7 +520,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
|
||||
|
||||
// Choose a bunch of backgrounds that we'll use for the random file marker
|
||||
{
|
||||
vector<RString> vsThrowAway, vsNames;
|
||||
std::vector<RString> vsThrowAway, vsNames;
|
||||
switch( g_RandomBackgroundMode )
|
||||
{
|
||||
default:
|
||||
@@ -539,7 +539,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
|
||||
// Pick the same random items every time the song is played.
|
||||
RandomGen rnd( GetHashForString(pSong->GetSongDir()) );
|
||||
random_shuffle( vsNames.begin(), vsNames.end(), rnd );
|
||||
int iSize = min( (int)g_iNumBackgrounds, (int)vsNames.size() );
|
||||
int iSize = std::min( (int)g_iNumBackgrounds, (int)vsNames.size() );
|
||||
vsNames.resize( iSize );
|
||||
|
||||
for (RString const &s : vsNames)
|
||||
@@ -718,7 +718,7 @@ int BackgroundImpl::Layer::FindBGSegmentForBeat( float fBeat ) const
|
||||
}
|
||||
|
||||
/* If the BG segment has changed, move focus to it. Send Update() calls. */
|
||||
void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const map<RString,BackgroundTransition> &mapNameToTransition )
|
||||
void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMusicSeconds, float fCurrentTime, const std::map<RString, BackgroundTransition> &mapNameToTransition )
|
||||
{
|
||||
ASSERT( fCurrentTime != GameState::MUSIC_SECONDS_INVALID );
|
||||
|
||||
@@ -750,7 +750,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
|
||||
m_pFadingBGA = m_pCurrentBGA;
|
||||
|
||||
map<BackgroundDef,Actor*>::const_iterator iter = m_BGAnimations.find( change.m_def );
|
||||
std::map<BackgroundDef, Actor*>::const_iterator iter = m_BGAnimations.find( change.m_def );
|
||||
if( iter == m_BGAnimations.end() )
|
||||
{
|
||||
XNode *pNode = change.m_def.CreateNode();
|
||||
@@ -776,7 +776,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
|
||||
if( !change.m_sTransition.empty() )
|
||||
{
|
||||
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
|
||||
std::map<RString, BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
|
||||
if(lIter == mapNameToTransition.end())
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("'%s' is not the name of a BackgroundTransition file.", change.m_sTransition.c_str());
|
||||
@@ -811,7 +811,7 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
}
|
||||
|
||||
/* This is unaffected by the music rate. */
|
||||
float fDeltaTimeNoMusicRate = max( fDeltaTime / fRate, 0 );
|
||||
float fDeltaTimeNoMusicRate = std::max( fDeltaTime / fRate, 0.0f );
|
||||
|
||||
if( m_pCurrentBGA )
|
||||
m_pCurrentBGA->Update( fDeltaTimeNoMusicRate );
|
||||
@@ -876,7 +876,7 @@ void BackgroundImpl::DrawPrimitives()
|
||||
ActorFrame::DrawPrimitives();
|
||||
}
|
||||
|
||||
void BackgroundImpl::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] )
|
||||
void BackgroundImpl::GetLoadedBackgroundChanges( std::vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] )
|
||||
{
|
||||
FOREACH_BackgroundLayer( i )
|
||||
*pBackgroundChangesOut[i] = m_Layer[i].m_aBGChanges;
|
||||
@@ -988,7 +988,7 @@ void Background::Unload() { m_pImpl->Unload(); }
|
||||
void Background::FadeToActualBrightness() { m_pImpl->FadeToActualBrightness(); }
|
||||
void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBrightness); }
|
||||
DancingCharacters* Background::GetDancingCharacters() { return m_pImpl->GetDancingCharacters(); }
|
||||
void Background::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); }
|
||||
void Background::GetLoadedBackgroundChanges( std::vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] ) { m_pImpl->GetLoadedBackgroundChanges(pBackgroundChangesOut); }
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Ben Nordstrom
|
||||
|
||||
Reference in New Issue
Block a user