mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- use FileReader for all operations on external lumps.
This commit is contained in:
parent
8d26760671
commit
14af7818b8
1 changed files with 8 additions and 9 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue