- moved buildtexture.cpp from using stdio-based file IO to FileReader.

This commit is contained in:
Christoph Oelckers 2017-12-02 11:57:32 +01:00
parent e1edb46bbb
commit 20b8c1ef70

View file

@ -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);
}
}