Skip to content

Commit b095f58

Browse files
feat: add missing hash count to meta info
1 parent c336262 commit b095f58

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,23 @@ $ ./fgptool -m META "/home/lxlewis/Downloads/PORTAL/"
113113
114114
BACKGROUND1.GRP
115115
File count: 2868
116+
Missing hashes: 87 (3.03347%)
116117
Loading screen path: materials/vgui/appchooser/background_portal.ps3.vtf
117118
BACKGROUND2.GRP
118119
File count: 2757
120+
Missing hashes: 83 (3.01052%)
119121
Loading screen path: materials/vgui/appchooser/background_portal.ps3.vtf
120122
ESCAPE_00.GRP
121123
File count: 3379
124+
Missing hashes: 91 (2.6931%)
122125
Loading screen path: materials/vgui/appchooser/background_portal.ps3.vtf
123126
ESCAPE_01.GRP
124127
File count: 3844
128+
Missing hashes: 104 (2.70552%)
125129
Loading screen path: materials/vgui/appchooser/background_portal.ps3.vtf
126130
ESCAPE_02.GRP
127131
File count: 4672
132+
Missing hashes: 113 (2.41866%)
128133
Loading screen path: materials/vgui/appchooser/background_portal.ps3.vtf
129134
```
130135

src/fgptool.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ void meta(const std::string& inputPath) {
259259
}
260260
std::cout << fgp->getFilename() << std::endl;
261261
std::cout << "\tFile count: " << fgp->getEntryCount() << std::endl;
262+
263+
const uint32_t total = fgp->getEntryCount();
264+
uint32_t existed = 0;
265+
fgp->runForAllEntries([&existed](const std::string& path, const Entry&) {
266+
existed += !path.starts_with("__hashed__/");
267+
});
268+
std::cout << "\tMissing hashes: " << (total - existed) << " (" << ((total - existed) / static_cast<double>(total) * 100) << "%)" << std::endl;
269+
262270
std::cout << "\tLoading screen path: " << dynamic_cast<FGP&>(*fgp).getLoadingScreenFilePath() << std::endl;
263271
}
264272

0 commit comments

Comments
 (0)