Allow preloading all song banners.
This commit is contained in:
@@ -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++ )
|
||||
|
||||
Reference in New Issue
Block a user