add BakeAllBackgroundChanges

This commit is contained in:
Chris Danford
2005-07-18 01:52:01 +00:00
parent b50482c185
commit f93cb4e320
4 changed files with 30 additions and 5 deletions
+15 -5
View File
@@ -78,6 +78,7 @@ public:
DancingCharacters* GetDancingCharacters() { return m_pDancingCharacters; };
void GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] );
protected:
bool m_bInitted;
@@ -313,7 +314,8 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
if( sToResolve.empty() )
{
if( i == 0 )
return false;
return false;
else
continue;
}
@@ -378,8 +380,8 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
// Set Lua color globals
LUA->SetGlobal( ssprintf("Color%d",1), 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( "Color1", bd.m_sColor1.empty() ? CString("1,1,1,1") : bd.m_sColor1 );
LUA->SetGlobal( "Color2", bd.m_sColor2.empty() ? CString("1,1,1,1") : bd.m_sColor2 );
// Resolve the effect file.
@@ -408,13 +410,14 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
Actor *pActor = ActorUtil::MakeActor( sEffectFile );
ASSERT( pActor );
m_BGAnimations[bd] = pActor;
for( unsigned i=0; i<vsResolved.size(); i++ )
LUA->SetGlobal( ssprintf("File%d",i+1), CString() );
LUA->SetGlobal( ssprintf("Color%d",1), CString() );
LUA->SetGlobal( ssprintf("Color%d",2), CString() );
LUA->UnsetGlobal( "Color1" );
LUA->UnsetGlobal( "Color2" );
return true;
}
@@ -914,6 +917,12 @@ void BackgroundImpl::DrawPrimitives()
ActorFrame::DrawPrimitives();
}
void BackgroundImpl::GetLoadedBackgroundChanges( vector<BackgroundChange> *pBackgroundChangesOut[NUM_BackgroundLayer] )
{
FOREACH_BackgroundLayer( i )
*pBackgroundChangesOut[i] = m_Layer[i].m_aBGChanges;
}
bool BackgroundImpl::IsDangerAllVisible()
{
FOREACH_PlayerNumber( p )
@@ -1014,6 +1023,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); }
/*
+2
View File
@@ -30,6 +30,8 @@ public:
DancingCharacters* GetDancingCharacters();
void GetLoadedBackgroundChanges( vector<BackgroundChange> **pBackgroundChangesOut );
protected:
BackgroundImpl *m_pImpl;
};
+11
View File
@@ -6,6 +6,7 @@
#include "IniFile.h"
#include "RageLog.h"
#include <set>
#include "Background.h"
bool BackgroundDef::operator<( const BackgroundDef &other ) const
@@ -299,6 +300,16 @@ found_files:
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
* All rights reserved.
+2
View File
@@ -72,6 +72,8 @@ namespace BackgroundUtil
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 GetGlobalRandomMovies( const Song *pSong, const CString &sMatch, vector<CString> &vsPathsOut, vector<CString> &vsNamesOut, bool bTryInsideOfSongGroupAndGenreFirst = true, bool bTryInsideOfSongGroupFirst = true );
void BakeAllBackgroundChanges( Song *pSong );
};