mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 08:01:50 +00:00
- moved buildtexture.cpp from using stdio-based file IO to FileReader.
This commit is contained in:
parent
e1edb46bbb
commit
20b8c1ef70
1 changed files with 5 additions and 5 deletions
|
@ -306,15 +306,16 @@ int FTextureManager::CountBuildTiles ()
|
|||
FString artpath = rffpath;
|
||||
artpath += artfile;
|
||||
|
||||
FILE *f = fopen (artpath, "rb");
|
||||
if (f == NULL)
|
||||
FileReader fr;
|
||||
|
||||
if (!fr.Open(artpath))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
size_t len = Q_filelength (f);
|
||||
long len = fr.GetLength();
|
||||
uint8_t *art = new uint8_t[len];
|
||||
if (fread (art, 1, len, f) != len || (numtiles = CountTiles(art)) == 0)
|
||||
if (fr.Read (art, len) != len || (numtiles = CountTiles(art)) == 0)
|
||||
{
|
||||
delete[] art;
|
||||
}
|
||||
|
@ -323,7 +324,6 @@ int FTextureManager::CountBuildTiles ()
|
|||
BuildTileFiles.Push (art);
|
||||
totaltiles += numtiles;
|
||||
}
|
||||
fclose (f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue