vivienneanthony

yada

Jan 1st, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. void GameAssetSelector::UpdateGameAssetsList(void)
  2. {
  3.     // Get File Sysstem
  4.     FileSystem * currentFileSystem = g_pApp->GetFileSystem();
  5.  
  6.     // String Results
  7.     Vector<String> dirs;
  8.     Vector<String> gameAssetResource;
  9.  
  10.     // Get filesystem directory
  11.     String currentPath = currentFileSystem->GetProgramDir()+"GameData/GameAssets/";
  12.  
  13.     // Get current path for all xml files
  14.     currentFileSystem->ScanDir(dirs, currentPath, "*", SCAN_DIRS, true);
  15.  
  16.     if(dirs.Size())
  17.     {
  18.         for(unsigned int currentDir=0; currentDir<dirs.Size(); currentDir++)
  19.         {
  20.             Vector <String> dirFiles;
  21.  
  22.             // remove garbage directories
  23.             if (dirs.At(currentDir).EndsWith("."))
  24.                 continue;
  25.  
  26.             currentFileSystem->ScanDir(dirFiles, currentPath+dirs.At(currentDir)+"/", "*.xml", SCAN_FILES, false);
  27.  
  28.             if(dirFiles.Size())
  29.             {
  30.                 // loop through each file listing
  31.                 for(unsigned int fileListing = 0; fileListing<dirFiles.Size(); fileListing++)
  32.                 {
  33.                     gameAssetResource.Push(dirFiles.At(fileListing));
  34.                 }
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment