From bcd4121686ebc61fbb2da8ca0a3fd743cea2a935 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 17 Jun 2003 21:34:43 +0000 Subject: [PATCH] handle group banners in the parent dir --- stepmania/src/SongManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 1f82e4e698..c60034ad53 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -130,14 +130,23 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName ) GetDirListing( sDir+sGroupDirName+"/*.jpg", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.gif", arrayGroupBanners ); GetDirListing( sDir+sGroupDirName+"/*.bmp", arrayGroupBanners ); - CString sBannerPath; + CString sBannerPath; if( !arrayGroupBanners.empty() ) - { sBannerPath = sDir+sGroupDirName+"/"+arrayGroupBanners[0] ; - LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.c_str(), sBannerPath.c_str() ); + else + { + // Look for a group banner in the parent folder + GetDirListing( sDir+sGroupDirName+".png", arrayGroupBanners ); + GetDirListing( sDir+sGroupDirName+".jpg", arrayGroupBanners ); + GetDirListing( sDir+sGroupDirName+".gif", arrayGroupBanners ); + GetDirListing( sDir+sGroupDirName+".bmp", arrayGroupBanners ); + if( !arrayGroupBanners.empty() ) + sBannerPath = sDir+arrayGroupBanners[0]; } + if( sBannerPath != "" ) + LOG->Trace( "Group banner for '%s' is '%s'.", sGroupDirName.c_str(), sBannerPath.c_str() ); m_arrayGroupNames.push_back( sGroupDirName ); m_GroupBannerPaths.push_back(sBannerPath); }