- use TArray and FString in resource file management.

This commit is contained in:
Christoph Oelckers 2018-11-10 14:19:55 +01:00
commit 191f2d9d76
13 changed files with 55 additions and 73 deletions

View file

@ -102,9 +102,9 @@ FDirectory::FDirectory(const char * directory)
#ifdef _WIN32
free((void *)directory);
#endif
dirname.ReplaceChars('\\', '/');
FixPathSeperator(dirname);
if (dirname[dirname.Len()-1] != '/') dirname += '/';
Filename = copystring(dirname);
FileName = dirname;
}
@ -248,7 +248,7 @@ int FDirectory::AddDirectory(const char *dirpath)
bool FDirectory::Open(bool quiet)
{
NumLumps = AddDirectory(Filename);
NumLumps = AddDirectory(FileName);
if (!quiet) Printf(", %d lumps\n", NumLumps);
PostProcessArchive(&Lumps[0], sizeof(FDirectoryLump));
return true;
@ -268,7 +268,7 @@ void FDirectory::AddEntry(const char *fullpath, int size)
lump_p->mFullPath = fullpath;
// [mxd] Convert name to lowercase
FString name = fullpath + strlen(Filename);
FString name = fullpath + strlen(FileName);
name.ToLower();
// The lump's name is only the part relative to the main directory