From 1f9f98078263d531157d68e624787323e8ae3920 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 10 Apr 2004 00:47:52 +0000 Subject: [PATCH] simplify don't strip "*danger*" backgrounds; the danger background doesn't go in BGAnimations anymore --- stepmania/src/Background.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 95443e1283..e521f862c8 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -207,16 +207,11 @@ CString Background::CreateRandomBGA() default: FAIL_M( ssprintf("Invalid BackgroundMode: %i", PREFSMAN->m_BackgroundMode) ); break; + case PrefsManager::BGMODE_ANIMATIONS: - { - GetDirListing( BG_ANIMS_DIR+"*", arrayPaths, true, true ); - // strip out "cvs" and "danger - int i; - for( i=arrayPaths.size()-1; i>=0; i-- ) - if( 0==stricmp(arrayPaths[i].Right(3),"cvs") || 0==stricmp(arrayPaths[i].Right(3),"danger") ) - arrayPaths.erase(arrayPaths.begin()+i, arrayPaths.begin()+i+1); - break; - } + GetDirListing( BG_ANIMS_DIR+"*", arrayPaths, true, true ); + break; + case PrefsManager::BGMODE_MOVIEVIS: GetDirListing( VISUALIZATIONS_DIR + "*.avi", arrayPaths, false, true ); GetDirListing( VISUALIZATIONS_DIR + "*.mpg", arrayPaths, false, true ); @@ -230,6 +225,11 @@ CString Background::CreateRandomBGA() break; } + // strip out "cvs" + for( int j=arrayPaths.size()-1; j>=0; j-- ) + if( !Basename(arrayPaths[j]).CompareNoCase("cvs") ) + arrayPaths.erase( arrayPaths.begin()+j, arrayPaths.begin()+j+1 ); + if( arrayPaths.empty() ) return "";