removed -hashfiles after finding out it had been broken for an extended time period.
this is a strong indicator that nobody was using it - and I do not feel like fixing such an invasive feature with little utility.
This commit is contained in:
parent
e0778e23eb
commit
9b62379645
3 changed files with 7 additions and 80 deletions
|
|
@ -238,7 +238,7 @@ bool FileSystem::InitSingleFile(const char* filename, FileSystemMessageFunc Prin
|
|||
return InitMultipleFiles(filenames, nullptr, Printf);
|
||||
}
|
||||
|
||||
bool FileSystem::InitMultipleFiles (std::vector<std::string>& filenames, LumpFilterInfo* filter, FileSystemMessageFunc Printf, bool allowduplicates, FILE* hashfile)
|
||||
bool FileSystem::InitMultipleFiles (std::vector<std::string>& filenames, LumpFilterInfo* filter, FileSystemMessageFunc Printf, bool allowduplicates)
|
||||
{
|
||||
int numfiles;
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ bool FileSystem::InitMultipleFiles (std::vector<std::string>& filenames, LumpFil
|
|||
|
||||
for(size_t i=0;i<filenames.size(); i++)
|
||||
{
|
||||
AddFile(filenames[i].c_str(), nullptr, filter, Printf, hashfile);
|
||||
AddFile(filenames[i].c_str(), nullptr, filter, Printf);
|
||||
|
||||
if (i == (unsigned)MaxIwadIndex) MoveLumpsInFolder("after_iwad/");
|
||||
std::string path = "filter/%s";
|
||||
|
|
@ -327,7 +327,7 @@ int FileSystem::AddFromBuffer(const char* name, char* data, int size, int id, in
|
|||
// [RH] Removed reload hack
|
||||
//==========================================================================
|
||||
|
||||
void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInfo* filter, FileSystemMessageFunc Printf, FILE* hashfile)
|
||||
void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInfo* filter, FileSystemMessageFunc Printf)
|
||||
{
|
||||
int startlump;
|
||||
bool isdir = false;
|
||||
|
|
@ -396,49 +396,10 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf
|
|||
path += ':';
|
||||
path += resfile->getName(i);
|
||||
auto embedded = resfile->GetEntryReader(i, READER_CACHED);
|
||||
AddFile(path.c_str(), &embedded, filter, Printf, hashfile);
|
||||
AddFile(path.c_str(), &embedded, filter, Printf);
|
||||
}
|
||||
}
|
||||
|
||||
if (hashfile)
|
||||
{
|
||||
uint8_t cksum[16];
|
||||
char cksumout[33];
|
||||
memset(cksumout, 0, sizeof(cksumout));
|
||||
|
||||
if (filereader.isOpen())
|
||||
{
|
||||
filereader.Seek(0, FileReader::SeekSet);
|
||||
md5Hash(filereader, cksum);
|
||||
|
||||
for (size_t j = 0; j < sizeof(cksum); ++j)
|
||||
{
|
||||
snprintf(cksumout + (j * 2), 3, "%02X", cksum[j]);
|
||||
}
|
||||
|
||||
fprintf(hashfile, "file: %s, hash: %s, size: %td\n", filename, cksumout, filereader.GetLength());
|
||||
}
|
||||
|
||||
else
|
||||
fprintf(hashfile, "file: %s, Directory structure\n", filename);
|
||||
|
||||
for (int i = 0; i < resfile->EntryCount(); i++)
|
||||
{
|
||||
int flags = resfile->GetEntryFlags(i);
|
||||
if (!(flags & RESFF_EMBEDDED))
|
||||
{
|
||||
auto reader = resfile->GetEntryReader(i, READER_SHARED, 0);
|
||||
md5Hash(filereader, cksum);
|
||||
|
||||
for (size_t j = 0; j < sizeof(cksum); ++j)
|
||||
{
|
||||
snprintf(cksumout + (j * 2), 3, "%02X", cksum[j]);
|
||||
}
|
||||
|
||||
fprintf(hashfile, "file: %s, lump: %s, hash: %s, size: %zu\n", filename, resfile->getName(i), cksumout, (uint64_t)resfile->Length(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue