diff --git a/src/common/filesystem/include/resourcefile.h b/src/common/filesystem/include/resourcefile.h index 12ab0ec71e..ddce567719 100644 --- a/src/common/filesystem/include/resourcefile.h +++ b/src/common/filesystem/include/resourcefile.h @@ -78,19 +78,12 @@ typedef enum { enum ELumpFlags { - LUMPF_MAYBEFLAT = 1, // might be a flat outside F_START/END - LUMPF_FULLPATH = 2, // contains a full path. This will trigger extended namespace checks when looking up short names. - LUMPF_EMBEDDED = 4, // marks an embedded resource file for later processing. - LUMPF_SHORTNAME = 8, // the stored name is a short extension-less name - LUMPF_COMPRESSED = 16, // compressed or encrypted, i.e. cannot be read with the container file's reader. - RESFF_MAYBEFLAT = 1, // might be a flat inside a WAD outside F_START/END RESFF_FULLPATH = 2, // contains a full path. This will trigger extended namespace checks when looking up short names. RESFF_EMBEDDED = 4, // marks an embedded resource file for later processing. RESFF_SHORTNAME = 8, // the stored name is a short extension-less name RESFF_COMPRESSED = 16, // compressed or encrypted, i.e. cannot be read with the container file's reader. RESFF_NEEDFILESTART = 32, // The real position is not known yet and needs to be calculated on access - }; struct FResourceEntry diff --git a/src/common/filesystem/source/file_wad.cpp b/src/common/filesystem/source/file_wad.cpp index 1970e7a401..8a81b3ced9 100644 --- a/src/common/filesystem/source/file_wad.cpp +++ b/src/common/filesystem/source/file_wad.cpp @@ -251,7 +251,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name // We can't add this to the flats namespace but // it needs to be flagged for the texture manager. Printf(FSMessageLevel::DebugNotify, "%s: Marking %s as potential flat\n", FileName, Entries[ii].FileName); - Entries[ii].Flags |= LUMPF_MAYBEFLAT; + Entries[ii].Flags |= RESFF_MAYBEFLAT; } } } diff --git a/src/common/filesystem/source/filesystem.cpp b/src/common/filesystem/source/filesystem.cpp index e08c8292a8..d418c3631c 100644 --- a/src/common/filesystem/source/filesystem.cpp +++ b/src/common/filesystem/source/filesystem.cpp @@ -112,7 +112,7 @@ struct FileSystem::LumpRecord auto lflags = file->GetEntryFlags(fileindex); if (!name) name = file->getName(fileindex); - if (lflags & LUMPF_SHORTNAME) + if (lflags & RESFF_SHORTNAME) { UpperCopy(shortName.String, name); shortName.String[8] = 0; @@ -120,7 +120,7 @@ struct FileSystem::LumpRecord Namespace = file->GetEntryNamespace(fileindex); resourceId = -1; } - else if ((lflags & LUMPF_EMBEDDED) || !name || !*name) + else if ((lflags & RESFF_EMBEDDED) || !name || !*name) { shortName.qword = 0; LongName = ""; @@ -391,7 +391,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf for (int i = 0; i < resfile->EntryCount(); i++) { int flags = resfile->GetEntryFlags(i); - if (flags & LUMPF_EMBEDDED) + if (flags & RESFF_EMBEDDED) { std::string path = filename; path += ':'; @@ -426,7 +426,7 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf for (int i = 0; i < resfile->EntryCount(); i++) { int flags = resfile->GetEntryFlags(i); - if (!(flags & LUMPF_EMBEDDED)) + if (!(flags & RESFF_EMBEDDED)) { auto reader = resfile->GetEntryReader(i, true); md5Hash(filereader, cksum); @@ -532,7 +532,7 @@ int FileSystem::CheckNumForName (const char *name, int space) const // work as well. auto lflags = lump.resfile->GetEntryFlags(lump.resindex); if (space > ns_specialzipdirectory && lump.Namespace == ns_global && - !((lflags ^lump.flags) & LUMPF_FULLPATH)) break; + !((lflags ^lump.flags) & RESFF_FULLPATH)) break; } i = NextLumpIndex[i]; } @@ -1470,7 +1470,7 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/) if (slash == nullptr) { - FileInfo[lump].flags = LUMPF_FULLPATH; + FileInfo[lump].flags = RESFF_FULLPATH; return true; // already is pathless. } @@ -1478,7 +1478,7 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int /*flags*/) // just create a new reference to the original data with a different name. oldlump.LongName = slash + 1; oldlump.resourceId = id; - oldlump.flags = LUMPF_FULLPATH; + oldlump.flags = RESFF_FULLPATH; FileInfo.push_back(oldlump); return true; } diff --git a/src/common/filesystem/source/resourcefile.cpp b/src/common/filesystem/source/resourcefile.cpp index 0e500287f9..f26327713e 100644 --- a/src/common/filesystem/source/resourcefile.cpp +++ b/src/common/filesystem/source/resourcefile.cpp @@ -106,13 +106,13 @@ void FResourceFile::CheckEmbedded(uint32_t entry, LumpFilterInfo* lfi) const char *c = strstr(FullName, ".wad"); // fixme: Use lfi for this. if (c && strlen(c) == 4 && (!strchr(FullName, '/') || IsFileInFolder(FullName))) { - Entries[entry].Flags |= LUMPF_EMBEDDED; + Entries[entry].Flags |= RESFF_EMBEDDED; } else if (lfi) for (auto& fstr : lfi->embeddings) { if (!stricmp(FullName, fstr.c_str())) { - Entries[entry].Flags |= LUMPF_EMBEDDED; + Entries[entry].Flags |= RESFF_EMBEDDED; } } } diff --git a/src/common/textures/texturemanager.cpp b/src/common/textures/texturemanager.cpp index 570e01315a..10a3d3367d 100644 --- a/src/common/textures/texturemanager.cpp +++ b/src/common/textures/texturemanager.cpp @@ -585,7 +585,7 @@ void FTextureManager::AddGroup(int wadnum, int ns, ETextureType usetype) } progressFunc(); } - else if (ns == ns_flats && fileSystem.GetFileFlags(firsttx) & LUMPF_MAYBEFLAT) + else if (ns == ns_flats && fileSystem.GetFileFlags(firsttx) & RESFF_MAYBEFLAT) { if (fileSystem.CheckNumForName(Name, ns) < firsttx) { @@ -971,7 +971,7 @@ void FTextureManager::AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &b if (ns == ns_global) { // In Zips all graphics must be in a separate namespace. - if (fileSystem.GetFileFlags(i) & LUMPF_FULLPATH) continue; + if (fileSystem.GetFileFlags(i) & RESFF_FULLPATH) continue; // Ignore lumps with empty names. if (fileSystem.CheckFileName(i, "")) continue; @@ -1425,7 +1425,7 @@ int FTextureManager::GuesstimateNumTextures () break; default: - if (fileSystem.GetFileFlags(i) & LUMPF_MAYBEFLAT) numtex++; + if (fileSystem.GetFileFlags(i) & RESFF_MAYBEFLAT) numtex++; break; }