This commit is contained in:
Glenn Maynard
2002-08-31 19:13:45 +00:00
parent f886280ab5
commit b0e3b7af6f
+18 -43
View File
@@ -142,49 +142,24 @@ try_element_again:
/////////////////////////////////////// ///////////////////////////////////////
// Search both the current theme and the default theme dirs for this element // Search both the current theme and the default theme dirs for this element
/////////////////////////////////////// ///////////////////////////////////////
if( sAssetCategory == "graphics" ) static const char *graphic_masks[] = {
{ "*.sprite", "*.png", "*.jpg", "*.bmp", "*.gif", "*.redir",
const char *masks[] = { "*.avi", "*.mpg", "*.mpeg", NULL
"*.sprite", "*.png", "*.jpg", "*.bmp", "*.gif", "*.redir", };
"*.avi", "*.mpg", "*.mpeg", NULL static const char *sound_masks[] = { ".set", ".mp3", ".ogg", ".wav", ".redir", NULL };
}; static const char *font_masks[] = { ".font", ".redir", NULL };
const char **asset_masks = NULL;
int i; if( sAssetCategory == "graphics" ) asset_masks = graphic_masks;
for(i = 0; masks[i]; ++i) else if( sAssetCategory == "sounds" ) asset_masks = sound_masks;
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + masks[i], else if( sAssetCategory == "fonts" ) asset_masks = font_masks;
asPossibleElementFilePaths, false, true ); else ASSERT(0); // Unknown theme asset category
int i;
for(i = 0; masks[i]; ++i) for(i = 0; asset_masks[i]; ++i)
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + masks[i], GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + asset_masks[i],
asPossibleElementFilePaths, false, true ); asPossibleElementFilePaths, false, true );
} for(i = 0; asset_masks[i]; ++i)
else if( sAssetCategory == "sounds" ) GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + asset_masks[i],
{ asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".set", asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".mp3", asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".ogg", asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".wav", asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".redir", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".set", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".mp3", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".ogg", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".wav", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".redir", asPossibleElementFilePaths, false, true );
}
else if( sAssetCategory == "fonts" )
{
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".font", asPossibleElementFilePaths, false, true );
GetDirListing( sCurrentThemeDir + sAssetCategory+"\\"+sFileName + ".redir", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".font", asPossibleElementFilePaths, false, true );
GetDirListing( sDefaultThemeDir + sAssetCategory+"\\"+sFileName + ".redir", asPossibleElementFilePaths, false, true );
}
else
{
ASSERT(0); // Unknown theme asset category;
}
if( asPossibleElementFilePaths.GetSize() == 0 ) if( asPossibleElementFilePaths.GetSize() == 0 )
{ {