Fix UseSongBG

Hmm.  Need some way of using rendering masks in BGAs.  Not full
access to the zbuffer, of course, just a way to implement things like
the masked-off stage scroll on top of an unmasked song background.

Being able to do this based on the alpha values of another image would
have a whole lot of bonuses for background animations, too; eg the
canonical trick of rendering things masked by a silhouette.  This is tricky
to implement, though.

It'd be even better if we could do this with full alpha.

Most multipass algorithms I can think of would require an alpha
channel on the framebuffer, though, and we very often don't have
that.  I'll keep thinking about it (and perhaps randomly brainstorming
into the nearest edit window, such as WinCVS ...)
This commit is contained in:
Glenn Maynard
2003-03-17 03:24:12 +00:00
parent db47d0825b
commit 331fdab2f8
+16 -13
View File
@@ -461,9 +461,6 @@ void BGAnimationLayer::LoadFromAniLayerFile( CString sPath )
void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
{
Song* pSong = GAMESTATE->m_pCurSong;
CString sSongBGPath = pSong && pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathTo("Graphics","Common fallback background");
Init();
if( sAniDir.Right(1) != "/" )
sAniDir += "/";
@@ -475,20 +472,26 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
IniFile ini(sPathToIni);
ini.ReadFile();
CString sFile;
ini.GetValue( sLayer, "File", sFile );
CString sPath;
ini.GetValue( sLayer, "File", sPath );
bool bUseSongBG = false;
ini.GetValueB( sLayer, "UseSongBG", bUseSongBG );
if( bUseSongBG )
sFile = sSongBGPath;
if( bUseSongBG ) {
/* Don't throw for missing song backgrounds. */
Song *pSong = GAMESTATE->m_pCurSong;
if(pSong && pSong->HasBackground())
sPath = pSong->GetBackgroundPath();
else
sPath = THEME->GetPathTo("Graphics","Common fallback background");
} else {
if( sPath == "" )
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() );
if( sFile == "" )
RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() );
CString sPath = sAniDir+sFile;
if( !DoesFileExist(sPath) )
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sFile.GetString() );
if( !DoesFileExist(sAniDir+sPath) )
RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sPath.GetString() );
sPath = sAniDir+sPath;
}
ini.GetValueI( sLayer, "Type", (int&)m_Type );
ini.GetValue ( sLayer, "Command", m_sCommand );