Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void appSetOldRootDirectory(const char *dir, bool recurse)
- {
- guard(appSetOldRootDirectory);
- if (dir[0] == 0) dir = "."; // using dir="" will cause scanning of "/dir1", "/dir2" etc (i.e. drive root)
- appStrncpyz(GRootDirectory, dir, ARRAY_COUNT(GRootDirectory));
- ScanGameDirectory(GRootDirectory, recurse);
- #if GEARS4
- if (GForceGame == GAME_Gears4)
- {
- const CGameFileInfo* manifest = appFindGameFile("BundleManifest.bin");
- if (manifest)
- {
- LoadGears4Manifest(manifest);
- }
- else
- {
- appError("Gears of War 4 requires BundleManifest.bin file which is missing.");
- }
- }
- #endif // GEARS4
- appPrintf("Found %d game files (%d skipped) at path \"%s\"\n", GameFiles.Num(), GNumForeignFiles, dir);
- #if UNREAL4
- // Should process .uexp and .ubulk files, register their information for .uasset
- for (int i = 0; i < GameFiles.Num(); i++)
- {
- CGameFileInfo *info = GameFiles[i];
- char SrcFile[MAX_PACKAGE_PATH];
- appStrncpyz(SrcFile, info->RelativeName, ARRAY_COUNT(SrcFile));
- char* s = strrchr(SrcFile, '.');
- if (s && (stricmp(s, ".uasset") == 0 || stricmp(s, ".umap") == 0))
- {
- static const char* additionalExtensions[] =
- {
- ".ubulk",
- ".uexp",
- };
- for (int ext = 0; ext < ARRAY_COUNT(additionalExtensions); ext++)
- {
- strcpy(s, additionalExtensions[ext]);
- const CGameFileInfo* file = appFindGameFile(SrcFile);
- if (file)
- {
- info->ExtraSizeInKb += file->SizeInKb;
- }
- }
- }
- }
- #endif // UNREAL4
- #if PRINT_HASH_DISTRIBUTION
- PrintHashDistribution();
- #endif
- unguardf("dir=%s", dir);
- }
- void appSetRootDirectoryOld(const char *dir, bool recurse)
- {
- guard(appSetRootDirectoryOld);
- if (dir[0] == 0) dir = "."; // using dir="" will cause scanning of "/dir1", "/dir2" etc (i.e. drive root)
- appStrncpyz(GOldRootDirectory, dir, ARRAY_COUNT(GOldRootDirectory));
- ScanOldGameDirectory(GOldRootDirectory, recurse);
- #if GEARS4
- if (GForceGame == GAME_Gears4)
- {
- const CGameFileInfo* manifest = appFindGameFile("BundleManifest.bin");
- if (manifest)
- {
- LoadGears4Manifest(manifest);
- }
- else
- {
- appError("Gears of War 4 requires BundleManifest.bin file which is missing.");
- }
- }
- #endif // GEARS4
- appPrintf("Found %d game files (%d skipped) at path \"%s\"\n", OldGameFiles.Num(), GNumOldForeignFiles, dir);
- #if UNREAL4
- // Should process .uexp and .ubulk files, register their information for .uasset
- for (int i = 0; i < OldGameFiles.Num(); i++)
- {
- CGameFileInfo *info = OldGameFiles[i];
- char SrcFile[MAX_PACKAGE_PATH];
- appStrncpyz(SrcFile, info->RelativeName, ARRAY_COUNT(SrcFile));
- char* s = strrchr(SrcFile, '.');
- if (s && (stricmp(s, ".uasset") == 0 || stricmp(s, ".umap") == 0))
- {
- static const char* additionalExtensions[] =
- {
- ".ubulk",
- ".uexp",
- };
- for (int ext = 0; ext < ARRAY_COUNT(additionalExtensions); ext++)
- {
- strcpy(s, additionalExtensions[ext]);
- const CGameFileInfo* file = appFindGameFile(SrcFile);
- if (file)
- {
- info->ExtraSizeInKb += file->SizeInKb;
- }
- }
- }
- }
- #endif // UNREAL4
- #if PRINT_HASH_DISTRIBUTION
- PrintHashDistribution();
- #endif
- unguardf("dir=%s", dir);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement