add BakeAllBackgroundChanges
This commit is contained in:
@@ -78,6 +78,7 @@ public:
|
|||||||
|
|
||||||
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
|
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
|
||||||
|
|
||||||
|
void GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_bInitted;
|
bool m_bInitted;
|
||||||
@@ -313,7 +314,8 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
|||||||
if( sToResolve.empty() )
|
if( sToResolve.empty() )
|
||||||
{
|
{
|
||||||
if( i == 0 )
|
if( i == 0 )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -378,8 +380,8 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
|||||||
|
|
||||||
|
|
||||||
// Set Lua color globals
|
// Set Lua color globals
|
||||||
LUA->SetGlobal( ssprintf("Color%d",1), bd.m_sColor1.empty() ? CString("1,1,1,1") : bd.m_sColor1 );
|
LUA->SetGlobal( "Color1", bd.m_sColor1.empty() ? CString("1,1,1,1") : bd.m_sColor1 );
|
||||||
LUA->SetGlobal( ssprintf("Color%d",2), bd.m_sColor2.empty() ? CString("1,1,1,1") : bd.m_sColor2 );
|
LUA->SetGlobal( "Color2", bd.m_sColor2.empty() ? CString("1,1,1,1") : bd.m_sColor2 );
|
||||||
|
|
||||||
|
|
||||||
// Resolve the effect file.
|
// Resolve the effect file.
|
||||||
@@ -408,13 +410,14 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
|||||||
|
|
||||||
|
|
||||||
Actor *pActor = ActorUtil::MakeActor( sEffectFile );
|
Actor *pActor = ActorUtil::MakeActor( sEffectFile );
|
||||||
|
|
||||||
ASSERT( pActor );
|
ASSERT( pActor );
|
||||||
m_BGAnimations[bd] = pActor;
|
m_BGAnimations[bd] = pActor;
|
||||||
|
|
||||||
for( unsigned i=0; i<vsResolved.size(); i++ )
|
for( unsigned i=0; i<vsResolved.size(); i++ )
|
||||||
LUA->SetGlobal( ssprintf("File%d",i+1), CString() );
|
LUA->SetGlobal( ssprintf("File%d",i+1), CString() );
|
||||||
LUA->SetGlobal( ssprintf("Color%d",1), CString() );
|
LUA->UnsetGlobal( "Color1" );
|
||||||
LUA->SetGlobal( ssprintf("Color%d",2), CString() );
|
LUA->UnsetGlobal( "Color2" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -914,6 +917,12 @@ void BackgroundImpl::DrawPrimitives()
|
|||||||
ActorFrame::DrawPrimitives();
|
ActorFrame::DrawPrimitives();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BackgroundImpl::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] )
|
||||||
|
{
|
||||||
|
FOREACH_BackgroundLayer( i )
|
||||||
|
*pBackgroundChangesOut[i] = m_Layer[i].m_aBGChanges;
|
||||||
|
}
|
||||||
|
|
||||||
bool BackgroundImpl::IsDangerAllVisible()
|
bool BackgroundImpl::IsDangerAllVisible()
|
||||||
{
|
{
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
@@ -1014,6 +1023,7 @@ void Background::Unload() { m_pImpl->Unload(); }
|
|||||||
void Background::FadeToActualBrightness() { m_pImpl->FadeToActualBrightness(); }
|
void Background::FadeToActualBrightness() { m_pImpl->FadeToActualBrightness(); }
|
||||||
void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBrightness); }
|
void Background::SetBrightness( float fBrightness ) { m_pImpl->SetBrightness(fBrightness); }
|
||||||
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); }
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public:
|
|||||||
|
|
||||||
DancingCharacters* GetDancingCharacters();
|
DancingCharacters* GetDancingCharacters();
|
||||||
|
|
||||||
|
void GetLoadedBackgroundChanges( vector<BackgroundChange> **pBackgroundChangesOut );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BackgroundImpl *m_pImpl;
|
BackgroundImpl *m_pImpl;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include "Background.h"
|
||||||
|
|
||||||
|
|
||||||
bool BackgroundDef::operator<( const BackgroundDef &other ) const
|
bool BackgroundDef::operator<( const BackgroundDef &other ) const
|
||||||
@@ -299,6 +300,16 @@ found_files:
|
|||||||
StripCvs( vsPathsOut, vsNamesOut );
|
StripCvs( vsPathsOut, vsNamesOut );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BackgroundUtil::BakeAllBackgroundChanges( Song *pSong )
|
||||||
|
{
|
||||||
|
Background bg;
|
||||||
|
bg.LoadFromSong( pSong );
|
||||||
|
vector<BackgroundChange> *vBGChanges[NUM_BackgroundLayer];
|
||||||
|
FOREACH_BackgroundLayer( i )
|
||||||
|
vBGChanges[i] = &pSong->GetBackgroundChanges(i);
|
||||||
|
bg.GetLoadedBackgroundChanges( vBGChanges );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford, Ben Nordstrom
|
* (c) 2001-2004 Chris Danford, Ben Nordstrom
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ namespace BackgroundUtil
|
|||||||
void GetSongBitmaps( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
|
void GetSongBitmaps( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
|
||||||
void GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
|
void GetGlobalBGAnimations( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut );
|
||||||
void GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true );
|
void GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true );
|
||||||
|
|
||||||
|
void BakeAllBackgroundChanges( Song *pSong );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user