- put the entire filesystem code into a namespace and created some subdirectories.

This commit is contained in:
Christoph Oelckers 2023-08-22 21:20:28 +02:00
commit ebb71cebf1
108 changed files with 308 additions and 225 deletions

View file

@ -520,7 +520,7 @@ void MapLoader::InitED()
FScanner sc;
if (filename.IsEmpty()) return;
int lump = fileSystem.CheckNumForFullName(filename, true, ns_global);
int lump = fileSystem.CheckNumForFullName(filename, true, FileSys::ns_global);
if (lump == -1) return;
sc.OpenLumpNum(lump);

View file

@ -736,14 +736,14 @@ static int FindGLNodesInWAD(int labellump)
glheader.Format("GL_%s", fileSystem.GetFileFullName(labellump));
if (glheader.Len()<=8)
{
int gllabel = fileSystem.CheckNumForName(glheader, ns_global, wadfile);
int gllabel = fileSystem.CheckNumForName(glheader, FileSys::ns_global, wadfile);
if (gllabel >= 0) return gllabel;
}
else
{
// Before scanning the entire WAD directory let's check first whether
// it is necessary.
int gllabel = fileSystem.CheckNumForName("GL_LEVEL", ns_global, wadfile);
int gllabel = fileSystem.CheckNumForName("GL_LEVEL", FileSys::ns_global, wadfile);
if (gllabel >= 0)
{
@ -753,7 +753,7 @@ static int FindGLNodesInWAD(int labellump)
{
if (fileSystem.GetFileContainer(lump)==wadfile)
{
FileData mem = fileSystem.ReadFile(lump);
auto mem = fileSystem.ReadFile(lump);
if (MatchHeader(fileSystem.GetFileFullName(labellump), GetStringFromLump(lump))) return lump;
}
}
@ -1199,11 +1199,11 @@ bool MapLoader::CheckCachedNodes(MapData *map)
UNSAFE_CCMD(clearnodecache)
{
FileList list;
FileSys::FileList list;
FString path = M_GetCachePath(false);
path += "/";
if (!ScanDirectory(list, path, "*", false))
if (!FileSys::ScanDirectory(list, path, "*", false))
{
Printf("Unable to scan node cache directory %s\n", path.GetChars());
return;

View file

@ -733,7 +733,7 @@ bool MapLoader::LoadExtendedNodes (FileReader &dalump, uint32_t id)
if (compressed)
{
FileReader zip;
if (zip.OpenDecompressor(dalump, -1, METHOD_ZLIB, false, true))
if (zip.OpenDecompressor(dalump, -1, FileSys::METHOD_ZLIB, false, true))
{
LoadZNodes(zip, type);
return true;
@ -753,7 +753,7 @@ bool MapLoader::LoadExtendedNodes (FileReader &dalump, uint32_t id)
{
Printf("Error loading nodes: %s\n", error.GetMessage());
}
catch (FileSystemException& error)
catch (FileSys::FileSystemException& error)
{
Printf("Error loading nodes: %s\n", error.what());
}
@ -1157,7 +1157,7 @@ void MapLoader::LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
template<class nodetype, class subsectortype>
bool MapLoader::LoadNodes (MapData * map)
{
FileData data;
FileSys::FileData data;
int j;
int k;
nodetype *mn;
@ -3338,7 +3338,7 @@ void MapLoader::LoadLightmap(MapData *map)
return;
FileReader fr;
if (!fr.OpenDecompressor(map->Reader(ML_LIGHTMAP), -1, METHOD_ZLIB, false, false))
if (!fr.OpenDecompressor(map->Reader(ML_LIGHTMAP), -1, FileSys::METHOD_ZLIB, false, false))
return;

View file

@ -2,8 +2,8 @@
#include "nodebuild.h"
#include "g_levellocals.h"
#include "files.h"
class FileReader;
struct FStrifeDialogueNode;
struct FStrifeDialogueReply;
struct Response;