- use FileReader for all operations on external lumps.

This commit is contained in:
Christoph Oelckers 2017-12-02 12:38:38 +01:00
parent 8d26760671
commit 14af7818b8
1 changed files with 8 additions and 9 deletions

View File

@ -669,12 +669,11 @@ FExternalLump::FExternalLump(const char *_filename, int filesize)
if (filesize == -1)
{
FILE *f = fopen(_filename,"rb");
if (f != NULL)
FileReader f;
if (f.Open(_filename))
{
fseek(f, 0, SEEK_END);
LumpSize = ftell(f);
fclose(f);
LumpSize = f.GetLength();
}
else
{
@ -703,11 +702,11 @@ FExternalLump::~FExternalLump()
int FExternalLump::FillCache()
{
Cache = new char[LumpSize];
FILE *f = fopen(filename, "rb");
if (f != NULL)
FileReader f;
if (f.Open(filename))
{
fread(Cache, 1, LumpSize, f);
fclose(f);
f.Read(Cache, LumpSize);
}
else
{