From 5a3961ad4e0f0683fe7c93287d26d1bd69123c51 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 2 Jun 2005 04:34:46 +0000 Subject: [PATCH] fix enumeration of backgrounds in BGChange MiniMenu --- stepmania/src/BackgroundUtil.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/stepmania/src/BackgroundUtil.cpp b/stepmania/src/BackgroundUtil.cpp index 21ff0123b2..0551bb350b 100644 --- a/stepmania/src/BackgroundUtil.cpp +++ b/stepmania/src/BackgroundUtil.cpp @@ -33,10 +33,14 @@ void BackgroundUtil::SortBackgroundChangesArray( vector &vBack sort( vBackgroundChanges.begin(), vBackgroundChanges.end(), CompareBackgroundChanges ); } -void BackgroundUtil::GetBackgroundEffects( const CString &sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundEffects( const CString &_sName, vector &vsPathsOut, vector &vsNamesOut ) { + CString sName = _sName; + if( sName == "" ) + sName = "*"; + vsPathsOut.clear(); - GetDirListing( BACKGROUND_EFFECTS_DIR+sName+"*.xml", vsPathsOut, false, true ); + GetDirListing( BACKGROUND_EFFECTS_DIR+sName+".xml", vsPathsOut, false, true ); vsNamesOut.clear(); FOREACH_CONST( CString, vsPathsOut, s ) @@ -45,10 +49,14 @@ void BackgroundUtil::GetBackgroundEffects( const CString &sName, vector StripCvs( vsPathsOut, vsNamesOut ); } -void BackgroundUtil::GetBackgroundTransitions( const CString &sName, vector &vsPathsOut, vector &vsNamesOut ) +void BackgroundUtil::GetBackgroundTransitions( const CString &_sName, vector &vsPathsOut, vector &vsNamesOut ) { + CString sName = _sName; + if( sName == "" ) + sName = "*"; + vsPathsOut.clear(); - GetDirListing( BACKGROUND_TRANSITIONS_DIR+sName+"*.xml", vsPathsOut, false, true ); + GetDirListing( BACKGROUND_TRANSITIONS_DIR+sName+".xml", vsPathsOut, false, true ); vsNamesOut.clear(); FOREACH_CONST( CString, vsPathsOut, s )