- got rid of FileSystem::GetFileData.

Using FMemFile is better in all these places.
This commit is contained in:
Christoph Oelckers 2023-08-19 16:49:07 +02:00
commit 5398045f7d
14 changed files with 50 additions and 84 deletions

View file

@ -410,7 +410,6 @@ void DFsScript::Preprocess(FLevelLocals *Level)
void DFsScript::ParseInclude(FLevelLocals *Level, char *lumpname)
{
int lumpnum;
char *lump;
if((lumpnum = fileSystem.CheckNumForName(lumpname)) == -1)
{
@ -419,21 +418,18 @@ void DFsScript::ParseInclude(FLevelLocals *Level, char *lumpname)
}
int lumplen=fileSystem.FileLength(lumpnum);
lump=new char[lumplen+10];
fileSystem.ReadFile(lumpnum,lump);
TArray<char> lump(lumplen + 10);
fileSystem.ReadFile(lumpnum,lump.Data());
lump[lumplen]=0;
// preprocess the include
// we assume that it does not include sections or labels or
// other nasty things
ProcessFindChar(lump, 0);
ProcessFindChar(lump.Data(), 0);
// now parse the lump
FParser parse(Level, this);
parse.Run(lump, lump, lump+lumplen);
// free the lump
delete[] lump;
parse.Run(lump.Data(), lump.Data(), lump.Data() + lumplen);
}