From db998a1d41332f0dd84f0a9eb7424b6d293a3334 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 4 Apr 2010 00:25:25 -0500 Subject: [PATCH] SongManager double shot: 1) Fix issue where course banners were read from cache even when BannerCache wasn't set to full mode. 2) Added GetSongGroupNames() and GetSongsInGroup(sGroupName) Lua bindings. --- src/SongManager.cpp | 61 +++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/src/SongManager.cpp b/src/SongManager.cpp index d6d62692f5..7b4ae8e441 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -338,47 +338,21 @@ void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) void SongManager::PreloadSongImages() { - bool bSkipBanners = false; - //bool bSkipBackgrounds = false; if( PREFSMAN->m_BannerCache != BNCACHE_FULL ) - bSkipBanners = true; - /* - if( PREFSMAN->m_BackgroundCache != BNCACHE_FULL ) - bSkipBackgrounds = true; - */ + return; /* Load textures before unloading old ones, so we don't reload textures * that we don't need to. */ RageTexturePreloader preload; - //if( !bSkipBanners && !bSkipBackgrounds ) - if( !bSkipBanners ) + const vector &songs = GetAllSongs(); + for( unsigned i = 0; i < songs.size(); ++i ) { - const vector &songs = GetAllSongs(); - for( unsigned i = 0; i < songs.size(); ++i ) - { - // preload banners - if( !songs[i]->HasBanner() && !songs[i]->HasBackground() ) - continue; + if( !songs[i]->HasBanner() ) + continue; - if( !bSkipBanners && songs[i]->HasBanner() ) - { - const RageTextureID ID = Sprite::SongBannerTexture( songs[i]->GetBannerPath() ); - preload.Load( ID ); - } - - // preload backgrounds - /* - if( !bSkipBackgrounds && songs[i]->HasBackground() ) - { - if ( !songs[i]->HasBackground() ) - continue; - - const RageTextureID IDbg = Sprite::SongBGTexture( songs[i]->GetBackgroundPath() ); - preload.Load( IDbg ); - } - */ - } + const RageTextureID ID = Sprite::SongBannerTexture( songs[i]->GetBannerPath() ); + preload.Load( ID ); } vector courses; @@ -1833,11 +1807,11 @@ public: const Style *pStyle = Luna