Allow preloading all song banners.

This commit is contained in:
Glenn Maynard
2003-11-25 22:56:48 +00:00
parent 262f80e8dd
commit da160607b8
7 changed files with 52 additions and 23 deletions
+21
View File
@@ -29,6 +29,8 @@
#include "GameManager.h"
#include "RageFile.h"
#include "ProductInfo.h"
#include "RageTextureManager.h"
#include "Banner.h"
SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program
@@ -302,6 +304,25 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
}
}
void SongManager::PreloadSongImages()
{
ASSERT( TEXTUREMAN );
if( PREFSMAN->m_BannerCache != PrefsManager::BNCACHE_FULL )
return;
const vector<Song*> &songs = SONGMAN->GetAllSongs();
unsigned i;
for( i = 0; i < songs.size(); ++i )
{
if( !songs[i]->HasBanner() )
continue;
const RageTextureID ID = Banner::BannerTex( songs[i]->GetBannerPath() );
TEXTUREMAN->CacheTexture( ID );
}
}
void SongManager::FreeSongs()
{
for( unsigned i=0; i<m_pSongs.size(); i++ )