Added -hashfiles command

This commit is contained in:
Edward Richardson 2015-03-17 18:07:50 +13:00
commit bf6cdba0bb
3 changed files with 78 additions and 0 deletions

View file

@ -214,6 +214,7 @@ bool autostart;
FString StoredWarp;
bool advancedemo;
FILE *debugfile;
FILE *hashfile;
event_t events[MAXEVENTS];
int eventhead;
int eventtail;
@ -2220,6 +2221,26 @@ void D_DoomMain (void)
execLogfile(logfile);
}
if (Args->CheckParm("-hashfiles"))
{
FString filename = "fileinfo.txt";
Printf("Hashing loaded content to: %s\n", filename);
hashfile = fopen(filename, "w");
if (hashfile)
{
fprintf(hashfile, "%s version %s (%s)\n", GAMENAME, GetVersionString(), GetGitHash());
#ifdef __VERSION__
fprintf(hashfile, "Compiler version: %s\n", __VERSION__);
#endif
fprintf(hashfile, "Command line:");
for (int i = 0; i < Args->NumArgs(); ++i)
{
fprintf(hashfile, " %s", Args->GetArg(i));
}
fprintf(hashfile, "\n");
}
}
D_DoomInit();
PClass::StaticInit ();
atterm(FinalGC);
@ -2289,6 +2310,11 @@ void D_DoomMain (void)
pwads.Clear();
pwads.ShrinkToFit();
if (hashfile)
{
Printf("Notice: File hashing is incredibly verbose. Expect loading files to take much longer then usual.\n");
}
Printf ("W_Init: Init WADfiles.\n");
Wads.InitMultipleFiles (allwads);
allwads.Clear();