From 09b89aa400b488ba8197d286bccd6170a485c61e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 22 Aug 2002 02:43:07 +0000 Subject: [PATCH] Simplify graphics search. Search for movies as graphics, too. --- stepmania/src/ThemeManager.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index 98320f66c0..36dee72e41 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -414,19 +414,19 @@ CString ThemeManager::GetPathTo( CString sAssetCategory, CString sFileName ) /////////////////////////////////////// if( sAssetCategory == "graphics" ) { - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.sprite", asPossibleElementFilePaths, false, true ); - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.png", asPossibleElementFilePaths, false, true ); - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.jpg", asPossibleElementFilePaths, false, true ); - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.bmp", asPossibleElementFilePaths, false, true ); - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.gif", asPossibleElementFilePaths, false, true ); - GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + "*.redir", asPossibleElementFilePaths, false, true ); + const char *masks[] = { + "*.sprite", "*.png", "*.jpg", "*.bmp", "*.gif", "*.redir", + "*.avi", "*.mpg", "*.mpeg", NULL + }; - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.sprite", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.png", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.jpg", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.bmp", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.gif", asPossibleElementFilePaths, false, true ); - GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + "*.redir", asPossibleElementFilePaths, false, true ); + int i; + for(i = 0; masks[i]; ++i) + GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + masks[i], + asPossibleElementFilePaths, false, true ); + + for(i = 0; masks[i]; ++i) + GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + masks[i], + asPossibleElementFilePaths, false, true ); } else if( sAssetCategory == "sounds" ) {