only cache course banners for courses that actually loaded

This commit is contained in:
Glenn Maynard
2004-12-02 23:04:15 +00:00
parent 8feae7b675
commit 82522540ba
+5 -5
View File
@@ -65,13 +65,8 @@ void Course::LoadFromCRSFile( CString sPath )
GetDirListing( sFName + ".bmp", arrayPossibleBanners, false, true ); GetDirListing( sFName + ".bmp", arrayPossibleBanners, false, true );
GetDirListing( sFName + ".gif", arrayPossibleBanners, false, true ); GetDirListing( sFName + ".gif", arrayPossibleBanners, false, true );
if( !arrayPossibleBanners.empty() ) if( !arrayPossibleBanners.empty() )
{
m_sBannerPath = arrayPossibleBanners[0]; m_sBannerPath = arrayPossibleBanners[0];
/* Cache and load the course banner. */
BANNERCACHE->CacheBanner( m_sBannerPath );
}
AttackArray attacks; AttackArray attacks;
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
{ {
@@ -260,6 +255,11 @@ void Course::LoadFromCRSFile( CString sPath )
tsub.Subst( title ); tsub.Subst( title );
m_sMainTitle = title.Title; m_sMainTitle = title.Title;
m_sMainTitleTranslit = title.TitleTranslit; m_sMainTitleTranslit = title.TitleTranslit;
/* Cache and load the course banner. Only bother doing this if at least one
* song was found in the course. */
if( m_sBannerPath != "" && !m_entries.empty() )
BANNERCACHE->CacheBanner( m_sBannerPath );
} }
void Course::RevertFromDisk() void Course::RevertFromDisk()