mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +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)
|
if (filesize == -1)
|
||||||
{
|
{
|
||||||
FILE *f = fopen(_filename,"rb");
|
FileReader f;
|
||||||
if (f != NULL)
|
|
||||||
|
if (f.Open(_filename))
|
||||||
{
|
{
|
||||||
fseek(f, 0, SEEK_END);
|
LumpSize = f.GetLength();
|
||||||
LumpSize = ftell(f);
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -703,11 +702,11 @@ FExternalLump::~FExternalLump()
|
||||||
int FExternalLump::FillCache()
|
int FExternalLump::FillCache()
|
||||||
{
|
{
|
||||||
Cache = new char[LumpSize];
|
Cache = new char[LumpSize];
|
||||||
FILE *f = fopen(filename, "rb");
|
FileReader f;
|
||||||
if (f != NULL)
|
|
||||||
|
if (f.Open(filename))
|
||||||
{
|
{
|
||||||
fread(Cache, 1, LumpSize, f);
|
f.Read(Cache, LumpSize);
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue