diff --git a/src/am_map.cpp b/src/am_map.cpp index c547884b2..9d8124891 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -845,7 +845,7 @@ static void AM_ParseArrow(TArray &Arrow, const char *lumpname) { const int R = int((8 * PLAYERRADIUS) / 7); FScanner sc; - int lump = fileSystem.CheckNumForFullName(lumpname, true); + int lump = fileSystem.CheckNumForAnyName(lumpname); if (lump >= 0) { sc.OpenLumpNum(lump); diff --git a/src/common/audio/music/i_music.cpp b/src/common/audio/music/i_music.cpp index d190537d4..959c8aaf4 100644 --- a/src/common/audio/music/i_music.cpp +++ b/src/common/audio/music/i_music.cpp @@ -53,9 +53,6 @@ #include "s_music.h" #include "filereadermusicinterface.h" -using namespace FileSys; - - void I_InitSoundFonts(); EXTERN_CVAR (Int, snd_samplerate) diff --git a/src/common/audio/music/i_soundfont.cpp b/src/common/audio/music/i_soundfont.cpp index 9737374fc..8edb5ab21 100644 --- a/src/common/audio/music/i_soundfont.cpp +++ b/src/common/audio/music/i_soundfont.cpp @@ -314,7 +314,7 @@ FileReader FLumpPatchSetReader::OpenMainConfigFile() FileReader FLumpPatchSetReader::OpenFile(const char *name) { FString path; - if (IsAbsPath(name)) return FileReader(); // no absolute paths in the lump directory. + if (IsAbsPath(name)) return FileReader(); // no absolute paths in the virtual file system. path = mBasePath + name; auto index = fileSystem.CheckNumForFullName(path.GetChars()); if (index < 0) return FileReader(); diff --git a/src/common/audio/music/music.cpp b/src/common/audio/music/music.cpp index 9664c5458..3e9202bef 100644 --- a/src/common/audio/music/music.cpp +++ b/src/common/audio/music/music.cpp @@ -114,7 +114,7 @@ static FileReader OpenMusic(const char* musicname) { int lumpnum; lumpnum = mus_cb.FindMusic(musicname); - if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, FileSys::ns_music); + if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, ns_music); if (lumpnum == -1) { Printf("Music \"%s\" not found\n", musicname); @@ -143,7 +143,7 @@ bool MusicExists(const char* music_name) { int lumpnum; lumpnum = mus_cb.FindMusic(music_name); - if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(music_name, FileSys::ns_music); + if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(music_name, ns_music); if (lumpnum != -1 && fileSystem.FileLength(lumpnum) != 0) return true; } diff --git a/src/common/cutscenes/movieplayer.cpp b/src/common/cutscenes/movieplayer.cpp index ecfc2d2d2..27d8f7271 100644 --- a/src/common/cutscenes/movieplayer.cpp +++ b/src/common/cutscenes/movieplayer.cpp @@ -508,7 +508,7 @@ public: } if (!MusicStream) { - Printf(PRINT_BOLD, "Failed to decode %s\n", fileSystem.GetFileName(soundtrack, false)); + Printf(PRINT_BOLD, "Failed to decode %s\n", fileSystem.GetFileName(soundtrack)); } } animtex.SetSize(AnimTexture::VPX, width, height); diff --git a/src/common/engine/sc_man.cpp b/src/common/engine/sc_man.cpp index ac7b4799f..5af08fa57 100644 --- a/src/common/engine/sc_man.cpp +++ b/src/common/engine/sc_man.cpp @@ -124,7 +124,7 @@ FScanner::FScanner(int lumpnum, TMap* extsymbols) : symbols(extsy void FScanner::Open (const char *name) { - int lump = fileSystem.CheckNumForFullName(name, true); + int lump = fileSystem.CheckNumForAnyName(name); if (lump == -1) { I_Error("Could not find script lump '%s'\n", name); diff --git a/src/common/engine/serializer.cpp b/src/common/engine/serializer.cpp index 7d947d9ce..5c5c9f566 100644 --- a/src/common/engine/serializer.cpp +++ b/src/common/engine/serializer.cpp @@ -58,8 +58,6 @@ #include "vm.h" #include "i_interface.h" -using namespace FileSys; - extern DObject *WP_NOCHANGE; bool save_full = false; // for testing. Should be removed afterward. @@ -155,13 +153,13 @@ bool FSerializer::OpenReader(const char *buffer, size_t length) // //========================================================================== -bool FSerializer::OpenReader(FCompressedBuffer *input) +bool FSerializer::OpenReader(FileSys::FCompressedBuffer *input) { if (input->mSize <= 0 || input->mBuffer == nullptr) return false; if (w != nullptr || r != nullptr) return false; mErrors = 0; - if (input->mMethod == METHOD_STORED) + if (input->mMethod == FileSys::METHOD_STORED) { r = new FReader((char*)input->mBuffer, input->mSize); } @@ -785,10 +783,10 @@ const char *FSerializer::GetOutput(unsigned *len) // //========================================================================== -FCompressedBuffer FSerializer::GetCompressedOutput() +FileSys::FCompressedBuffer FSerializer::GetCompressedOutput() { if (isReading()) return{ 0,0,0,0,0,nullptr }; - FCompressedBuffer buff; + FileSys::FCompressedBuffer buff; WriteObjects(); EndObject(); buff.filename = nullptr; @@ -827,7 +825,7 @@ FCompressedBuffer FSerializer::GetCompressedOutput() if (err == Z_OK) { buff.mBuffer = new char[buff.mCompressedSize]; - buff.mMethod = METHOD_DEFLATE; + buff.mMethod = FileSys::METHOD_DEFLATE; memcpy(buff.mBuffer, compressbuf, buff.mCompressedSize); delete[] compressbuf; return buff; @@ -836,7 +834,7 @@ FCompressedBuffer FSerializer::GetCompressedOutput() error: memcpy(compressbuf, w->mOutString.GetString(), buff.mSize + 1); buff.mCompressedSize = buff.mSize; - buff.mMethod = METHOD_STORED; + buff.mMethod = FileSys::METHOD_STORED; return buff; } diff --git a/src/common/engine/stringtable.cpp b/src/common/engine/stringtable.cpp index d9d739b57..d748157db 100644 --- a/src/common/engine/stringtable.cpp +++ b/src/common/engine/stringtable.cpp @@ -47,7 +47,7 @@ // //========================================================================== -void FStringTable::LoadStrings (FileSys::FileSystem& fileSystem, const char *language) +void FStringTable::LoadStrings (FileSystem& fileSystem, const char *language) { int lastlump, lump; diff --git a/src/common/engine/stringtable.h b/src/common/engine/stringtable.h index 181d8c7f3..193045d9f 100644 --- a/src/common/engine/stringtable.h +++ b/src/common/engine/stringtable.h @@ -84,7 +84,7 @@ public: using LangMap = TMap; using StringMacroMap = TMap; - void LoadStrings(FileSys::FileSystem& fileSystem, const char *language); + void LoadStrings(FileSystem& fileSystem, const char *language); void UpdateLanguage(const char* language); StringMap GetDefaultStrings() { return allStrings[default_table]; } // Dehacked needs these for comparison void SetOverrideStrings(StringMap & map) diff --git a/src/common/filesystem/include/fs_filesystem.h b/src/common/filesystem/include/fs_filesystem.h index 7fc8fc50f..ce49d765f 100644 --- a/src/common/filesystem/include/fs_filesystem.h +++ b/src/common/filesystem/include/fs_filesystem.h @@ -66,8 +66,13 @@ public: inline int GetNumForName (const uint8_t *name, int ns) const { return GetNumForName ((const char *)name, ns); } int CheckNumForFullName (const char *cname, bool trynormal = false, int namespc = ns_global, bool ignoreext = false) const; - int CheckNumForFullName (const char *name, int wadfile) const; + int CheckNumForFullNameInFile (const char *name, int wadfile) const; int GetNumForFullName (const char *name) const; + int CheckNumForAnyName(const char* cname, namespace_t namespc = ns_global) const + { + return CheckNumForFullName(cname, true, namespc); + } + int FindFile(const char* name) const { return CheckNumForFullName(name); diff --git a/src/common/filesystem/include/resourcefile.h b/src/common/filesystem/include/resourcefile.h index a23914444..e1a55ce7d 100644 --- a/src/common/filesystem/include/resourcefile.h +++ b/src/common/filesystem/include/resourcefile.h @@ -45,6 +45,8 @@ using FileSystemMessageFunc = int(*)(FSMessageLevel msglevel, const char* format class FResourceFile; +} + // [RH] Namespaces from BOOM. // These are needed here in the low level part so that WAD files can be properly set up. typedef enum { @@ -76,6 +78,8 @@ typedef enum { ns_firstskin, } namespace_t; +namespace FileSys { + enum ELumpFlags { RESFF_MAYBEFLAT = 1, // might be a flat inside a WAD outside F_START/END diff --git a/src/common/filesystem/source/filesystem.cpp b/src/common/filesystem/source/filesystem.cpp index 511686539..ec305e15f 100644 --- a/src/common/filesystem/source/filesystem.cpp +++ b/src/common/filesystem/source/filesystem.cpp @@ -594,7 +594,7 @@ int FileSystem::CheckNumForFullName (const char *name, bool trynormal, int names return -1; } -int FileSystem::CheckNumForFullName (const char *name, int rfnum) const +int FileSystem::CheckNumForFullNameInFile (const char *name, int rfnum) const { uint32_t i; diff --git a/src/common/fonts/v_font.cpp b/src/common/fonts/v_font.cpp index d838fb181..4b339d757 100644 --- a/src/common/fonts/v_font.cpp +++ b/src/common/fonts/v_font.cpp @@ -120,7 +120,7 @@ FFont *V_GetFont(const char *name, const char *fontlumpname) } - lump = fileSystem.CheckNumForFullName(fontlumpname? fontlumpname : name, true); + lump = fileSystem.CheckNumForAnyName(fontlumpname? fontlumpname : name); if (lump != -1 && fileSystem.GetFileContainer(lump) >= folderfile) { @@ -871,7 +871,7 @@ void V_InitFonts() FFont *CreateHexLumpFont(const char *fontname, int lump); FFont *CreateHexLumpFont2(const char *fontname, int lump); - auto lump = fileSystem.CheckNumForFullName("newconsolefont.hex", 0); // This is always loaded from gzdoom.pk3 to prevent overriding it with incomplete replacements. + auto lump = fileSystem.CheckNumForFullNameInFile("newconsolefont.hex", 0); // This is always loaded from gzdoom.pk3 to prevent overriding it with incomplete replacements. if (lump == -1) I_FatalError("newconsolefont.hex not found"); // This font is needed - do not start up without it. NewConsoleFont = CreateHexLumpFont("NewConsoleFont", lump); NewSmallFont = CreateHexLumpFont2("NewSmallFont", lump); diff --git a/src/common/menu/menudef.cpp b/src/common/menu/menudef.cpp index ad02001e0..081263d98 100644 --- a/src/common/menu/menudef.cpp +++ b/src/common/menu/menudef.cpp @@ -1524,7 +1524,7 @@ void M_ParseMenuDefs() DefaultOptionMenuSettings->Reset(); OptionSettings.mLinespacing = 17; - int IWADMenu = fileSystem.CheckNumForName("MENUDEF", FileSys::ns_global, fileSystem.GetIwadNum()); + int IWADMenu = fileSystem.CheckNumForName("MENUDEF", ns_global, fileSystem.GetIwadNum()); while ((lump = fileSystem.FindLump ("MENUDEF", &lastlump)) != -1) { diff --git a/src/common/rendering/gl/gl_shader.cpp b/src/common/rendering/gl/gl_shader.cpp index bafbf89b8..b091e9d1d 100644 --- a/src/common/rendering/gl/gl_shader.cpp +++ b/src/common/rendering/gl/gl_shader.cpp @@ -373,10 +373,10 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * i_data += "#define NPOT_EMULATION\nuniform vec2 uNpotEmulation;\n"; #endif - int vp_lump = fileSystem.CheckNumForFullName(vert_prog_lump, 0); + int vp_lump = fileSystem.CheckNumForFullNameInFile(vert_prog_lump, 0); if (vp_lump == -1) I_Error("Unable to load '%s'", vert_prog_lump); - int fp_lump = fileSystem.CheckNumForFullName(frag_prog_lump, 0); + int fp_lump = fileSystem.CheckNumForFullNameInFile(frag_prog_lump, 0); if (fp_lump == -1) I_Error("Unable to load '%s'", frag_prog_lump); @@ -418,7 +418,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (*proc_prog_lump != '#') { - int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump, 0); // if it's a core shader, ignore overrides by user mods. + int pp_lump = fileSystem.CheckNumForFullNameInFile(proc_prog_lump, 0); // if it's a core shader, ignore overrides by user mods. if (pp_lump == -1) pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump); if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump); FString pp_data = GetStringFromLump(pp_lump); @@ -429,13 +429,13 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (pp_data.IndexOf("GetTexCoord") >= 0) { - int pl_lump = fileSystem.CheckNumForFullName("shaders/glsl/func_defaultmat2.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders/glsl/func_defaultmat2.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders/glsl/func_defaultmat2.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); } else { - int pl_lump = fileSystem.CheckNumForFullName("shaders/glsl/func_defaultmat.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders/glsl/func_defaultmat.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders/glsl/func_defaultmat.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); @@ -461,7 +461,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (pp_data.IndexOf("ProcessLight") < 0) { - int pl_lump = fileSystem.CheckNumForFullName("shaders/glsl/func_defaultlight.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders/glsl/func_defaultlight.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders/glsl/func_defaultlight.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); } @@ -483,7 +483,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char * if (light_fragprog) { - int pp_lump = fileSystem.CheckNumForFullName(light_fragprog, 0); + int pp_lump = fileSystem.CheckNumForFullNameInFile(light_fragprog, 0); if (pp_lump == -1) I_Error("Unable to load '%s'", light_fragprog); fp_comb << GetStringFromLump(pp_lump) << "\n"; } diff --git a/src/common/rendering/gles/gles_shader.cpp b/src/common/rendering/gles/gles_shader.cpp index dba9a233a..930214a24 100644 --- a/src/common/rendering/gles/gles_shader.cpp +++ b/src/common/rendering/gles/gles_shader.cpp @@ -381,10 +381,10 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * i_data += "#define NPOT_EMULATION\nuniform vec2 uNpotEmulation;\n"; #endif - int vp_lump = fileSystem.CheckNumForFullName(vert_prog_lump.GetChars(), 0); + int vp_lump = fileSystem.CheckNumForFullNameInFile(vert_prog_lump.GetChars(), 0); if (vp_lump == -1) I_Error("Unable to load '%s'", vert_prog_lump.GetChars()); - int fp_lump = fileSystem.CheckNumForFullName(frag_prog_lump.GetChars(), 0); + int fp_lump = fileSystem.CheckNumForFullNameInFile(frag_prog_lump.GetChars(), 0); if (fp_lump == -1) I_Error("Unable to load '%s'", frag_prog_lump.GetChars()); @@ -428,13 +428,13 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * if (pp_data.IndexOf("GetTexCoord") >= 0) { - int pl_lump = fileSystem.CheckNumForFullName("shaders_gles/glsl/func_defaultmat2.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders_gles/glsl/func_defaultmat2.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders_gles/glsl/func_defaultmat2.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); } else { - int pl_lump = fileSystem.CheckNumForFullName("shaders_gles/glsl/func_defaultmat.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders_gles/glsl/func_defaultmat.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders_gles/glsl/func_defaultmat.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); @@ -460,7 +460,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * if (pp_data.IndexOf("ProcessLight") < 0) { - int pl_lump = fileSystem.CheckNumForFullName("shaders_gles/glsl/func_defaultlight.fp", 0); + int pl_lump = fileSystem.CheckNumForFullNameInFile("shaders_gles/glsl/func_defaultlight.fp", 0); if (pl_lump == -1) I_Error("Unable to load '%s'", "shaders_gles/glsl/func_defaultlight.fp"); fp_comb << "\n" << GetStringFromLump(pl_lump); } @@ -482,7 +482,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char * if (light_fragprog.Len()) { - int pp_lump = fileSystem.CheckNumForFullName(light_fragprog.GetChars(), 0); + int pp_lump = fileSystem.CheckNumForFullNameInFile(light_fragprog.GetChars(), 0); if (pp_lump == -1) I_Error("Unable to load '%s'", light_fragprog.GetChars()); fp_comb << GetStringFromLump(pp_lump) << "\n"; } diff --git a/src/common/rendering/vulkan/shaders/vk_shader.cpp b/src/common/rendering/vulkan/shaders/vk_shader.cpp index 00734ac7f..a04fb972c 100644 --- a/src/common/rendering/vulkan/shaders/vk_shader.cpp +++ b/src/common/rendering/vulkan/shaders/vk_shader.cpp @@ -465,7 +465,7 @@ FString VkShaderManager::GetTargetGlslVersion() FString VkShaderManager::LoadPublicShaderLump(const char *lumpname) { - int lump = fileSystem.CheckNumForFullName(lumpname, 0); + int lump = fileSystem.CheckNumForFullNameInFile(lumpname, 0); if (lump == -1) lump = fileSystem.CheckNumForFullName(lumpname); if (lump == -1) I_Error("Unable to load '%s'", lumpname); return GetStringFromLump(lump); @@ -473,7 +473,7 @@ FString VkShaderManager::LoadPublicShaderLump(const char *lumpname) FString VkShaderManager::LoadPrivateShaderLump(const char *lumpname) { - int lump = fileSystem.CheckNumForFullName(lumpname, 0); + int lump = fileSystem.CheckNumForFullNameInFile(lumpname, 0); if (lump == -1) I_Error("Unable to load '%s'", lumpname); return GetStringFromLump(lump); } diff --git a/src/common/scripting/frontend/zcc_parser.cpp b/src/common/scripting/frontend/zcc_parser.cpp index 6ea3c316e..e96ccc773 100644 --- a/src/common/scripting/frontend/zcc_parser.cpp +++ b/src/common/scripting/frontend/zcc_parser.cpp @@ -304,7 +304,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void { if (filename != nullptr) { - lump = fileSystem.CheckNumForFullName(filename, true); + lump = fileSystem.CheckNumForAnyName(filename); if (lump >= 0) { lsc.OpenLumpNum(lump); @@ -480,7 +480,7 @@ PNamespace *ParseOneScript(const int baselump, ZCCParseState &state) ParseSingleFile(&sc, nullptr, lumpnum, parser, state); for (unsigned i = 0; i < Includes.Size(); i++) { - lumpnum = fileSystem.CheckNumForFullName(Includes[i].GetChars(), true); + lumpnum = fileSystem.CheckNumForAnyName(Includes[i].GetChars()); if (lumpnum == -1) { IncludeLocs[i].Message(MSG_ERROR, "Include script lump %s not found", Includes[i].GetChars()); diff --git a/src/common/startscreen/endoom.cpp b/src/common/startscreen/endoom.cpp index 6e8e7af35..4dd160c0f 100644 --- a/src/common/startscreen/endoom.cpp +++ b/src/common/startscreen/endoom.cpp @@ -153,7 +153,7 @@ int RunEndoom() return 0; } - int endoom_lump = fileSystem.CheckNumForFullName (endoomName.GetChars(), true); + int endoom_lump = fileSystem.CheckNumForAnyName (endoomName.GetChars()); if (endoom_lump < 0 || fileSystem.FileLength (endoom_lump) != 4000) { diff --git a/src/common/startscreen/startscreen_generic.cpp b/src/common/startscreen/startscreen_generic.cpp index b76cbd3e2..4c41bc7a8 100644 --- a/src/common/startscreen/startscreen_generic.cpp +++ b/src/common/startscreen/startscreen_generic.cpp @@ -72,7 +72,7 @@ FGenericStartScreen::FGenericStartScreen(int max_progress) : FStartScreen(max_progress) { // at this point we do not have a working texture manager yet, so we have to do the lookup via the file system - int startup_lump = fileSystem.CheckNumForName("BOOTLOGO", FileSys::ns_graphics); + int startup_lump = fileSystem.CheckNumForName("BOOTLOGO", ns_graphics); StartupBitmap.Create(640 * 2, 480 * 2); ClearBlock(StartupBitmap, { 0, 0, 0, 255 }, 0, 0, 640 * 2, 480 * 2); diff --git a/src/common/startscreen/startscreen_hexen.cpp b/src/common/startscreen/startscreen_hexen.cpp index a82e21b35..6eef73599 100644 --- a/src/common/startscreen/startscreen_hexen.cpp +++ b/src/common/startscreen/startscreen_hexen.cpp @@ -81,9 +81,9 @@ FHexenStartScreen::FHexenStartScreen(int max_progress) : FStartScreen(max_progress) { // at this point we do not have a working texture manager yet, so we have to do the lookup via the file system - int startup_lump = fileSystem.CheckNumForName("STARTUP", FileSys::ns_graphics); - int netnotch_lump = fileSystem.CheckNumForName("NETNOTCH", FileSys::ns_graphics); - int notch_lump = fileSystem.CheckNumForName("NOTCH", FileSys::ns_graphics); + int startup_lump = fileSystem.CheckNumForName("STARTUP", ns_graphics); + int netnotch_lump = fileSystem.CheckNumForName("NETNOTCH", ns_graphics); + int notch_lump = fileSystem.CheckNumForName("NOTCH", ns_graphics); // For backwards compatibility we also need to look in the default namespace, because these were previously not handled as graphics. if (startup_lump == -1) startup_lump = fileSystem.CheckNumForName("STARTUP"); diff --git a/src/common/startscreen/startscreen_strife.cpp b/src/common/startscreen/startscreen_strife.cpp index df5467f96..8f02b2022 100644 --- a/src/common/startscreen/startscreen_strife.cpp +++ b/src/common/startscreen/startscreen_strife.cpp @@ -111,7 +111,7 @@ FStrifeStartScreen::FStrifeStartScreen(int max_progress) // Load the background and animated overlays. for (size_t i = 0; i < countof(StrifeStartupPicNames); ++i) { - int lumpnum = fileSystem.CheckNumForName(StrifeStartupPicNames[i], FileSys::ns_graphics); + int lumpnum = fileSystem.CheckNumForName(StrifeStartupPicNames[i], ns_graphics); if (lumpnum < 0) lumpnum = fileSystem.CheckNumForName(StrifeStartupPicNames[i]); if (lumpnum >= 0) diff --git a/src/common/textures/gametexture.cpp b/src/common/textures/gametexture.cpp index 179ea5a8f..28acc5c24 100644 --- a/src/common/textures/gametexture.cpp +++ b/src/common/textures/gametexture.cpp @@ -182,7 +182,7 @@ void FGameTexture::AddAutoMaterials() if (this->*(layer.pointer) == nullptr) // only if no explicit assignment had been done. { FStringf lookup("%s%s%s", layer.path, fullname ? "" : "auto/", searchname.GetChars()); - auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), false, FileSys::ns_global, true); + auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), true); if (lump != -1) { auto bmtex = TexMan.FindGameTexture(fileSystem.GetFileName(lump), ETextureType::Any, FTextureManager::TEXMAN_TryAny); @@ -199,7 +199,7 @@ void FGameTexture::AddAutoMaterials() if (!this->Layers || this->Layers.get()->*(layer.pointer) == nullptr) // only if no explicit assignment had been done. { FStringf lookup("%s%s%s", layer.path, fullname ? "" : "auto/", searchname.GetChars()); - auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), false, FileSys::ns_global, true); + auto lump = fileSystem.CheckNumForFullName(lookup.GetChars(), true); if (lump != -1) { auto bmtex = TexMan.FindGameTexture(fileSystem.GetFileName(lump), ETextureType::Any, FTextureManager::TEXMAN_TryAny); diff --git a/src/common/textures/texturemanager.cpp b/src/common/textures/texturemanager.cpp index 63b2adee7..a84639a8c 100644 --- a/src/common/textures/texturemanager.cpp +++ b/src/common/textures/texturemanager.cpp @@ -723,8 +723,8 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build FName texname = sc.String; sc.MustGetString(); - int lumpnum = fileSystem.CheckNumForFullName(sc.String, true, ns_patches); - if (lumpnum == -1) lumpnum = fileSystem.CheckNumForFullName(sc.String, true, ns_graphics); + int lumpnum = fileSystem.CheckNumForAnyName(sc.String, ns_patches); + if (lumpnum == -1) lumpnum = fileSystem.CheckNumForAnyName(sc.String, ns_graphics); if (tlist.Size() == 0) { @@ -779,8 +779,8 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build { FString src = base.Left(8); - int lumpnum = fileSystem.CheckNumForFullName(sc.String, true, ns_patches); - if (lumpnum == -1) lumpnum = fileSystem.CheckNumForFullName(sc.String, true, ns_graphics); + int lumpnum = fileSystem.CheckNumForAnyName(sc.String, ns_patches); + if (lumpnum == -1) lumpnum = fileSystem.CheckNumForAnyName(sc.String, ns_graphics); sc.GetString(); bool is32bit = !!sc.Compare("force32bit"); @@ -854,7 +854,7 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build sc.MustGetString(); // This is not using sc.Open because it can print a more useful error message when done here - int includelump = fileSystem.CheckNumForFullName(sc.String, true); + int includelump = fileSystem.CheckNumForAnyName(sc.String); if (includelump == -1) { sc.ScriptError("Lump '%s' not found", sc.String); @@ -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) & RESFF_FULLPATH) continue; + if (fileSystem.GetFileFlags(i) & FileSys::RESFF_FULLPATH) continue; // Ignore lumps with empty names. if (fileSystem.CheckFileName(i, "")) continue; @@ -1109,7 +1109,7 @@ void FTextureManager::SortTexturesByType(int start, int end) void FTextureManager::AddLocalizedVariants() { - std::vector content; + std::vector content; fileSystem.GetFilesInFolder("localized/textures/", content, false); for (auto &entry : content) { diff --git a/src/d_main.cpp b/src/d_main.cpp index 9c1c6931f..aa5bfdf9a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1984,8 +1984,8 @@ static FString CheckGameInfo(std::vector & pwads) static void SetMapxxFlag() { int lump_name = fileSystem.CheckNumForName("MAP01", ns_global, fileSystem.GetIwadNum()); - int lump_wad = fileSystem.CheckNumForFullName("maps/map01.wad", fileSystem.GetIwadNum()); - int lump_map = fileSystem.CheckNumForFullName("maps/map01.map", fileSystem.GetIwadNum()); + int lump_wad = fileSystem.CheckNumForFullNameInFile("maps/map01.wad", fileSystem.GetIwadNum()); + int lump_map = fileSystem.CheckNumForFullNameInFile("maps/map01.map", fileSystem.GetIwadNum()); if (lump_name >= 0 || lump_wad >= 0 || lump_map >= 0) gameinfo.flags |= GI_MAPxx; } diff --git a/src/g_game.cpp b/src/g_game.cpp index f43642813..7c7161aef 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2909,7 +2909,7 @@ void G_DoPlayDemo (void) gameaction = ga_nothing; // [RH] Allow for demos not loaded as lumps - demolump = fileSystem.CheckNumForFullName (defdemoname.GetChars(), true); + demolump = fileSystem.CheckNumForAnyName (defdemoname.GetChars()); if (demolump >= 0) { int demolen = fileSystem.FileLength (demolump); diff --git a/src/g_statusbar/sbarinfo.cpp b/src/g_statusbar/sbarinfo.cpp index 6bb27d179..70351664d 100644 --- a/src/g_statusbar/sbarinfo.cpp +++ b/src/g_statusbar/sbarinfo.cpp @@ -443,7 +443,7 @@ void SBarInfo::Load() { if(gameinfo.statusbar.IsNotEmpty()) { - int lump = fileSystem.CheckNumForFullName(gameinfo.statusbar.GetChars(), true); + int lump = fileSystem.CheckNumForAnyName(gameinfo.statusbar.GetChars()); if(lump != -1) { if (!batchrun) Printf ("ParseSBarInfo: Loading default status bar definition.\n"); @@ -481,7 +481,7 @@ void SBarInfo::ParseSBarInfo(int lump) if(sc.TokenType == TK_Include) { sc.MustGetToken(TK_StringConst); - int lump = fileSystem.CheckNumForFullName(sc.String, true); + int lump = fileSystem.CheckNumForAnyName(sc.String); if (lump == -1) sc.ScriptError("Lump '%s' not found", sc.String); ParseSBarInfo(lump); @@ -496,15 +496,15 @@ void SBarInfo::ParseSBarInfo(int lump) sc.MustGetToken(TK_Identifier); if(sc.Compare("Doom")) { - baselump = fileSystem.CheckNumForFullName("sbarinfo/doom.txt", true); + baselump = fileSystem.CheckNumForFullName("sbarinfo/doom.txt"); } else if(sc.Compare("Heretic")) { - baselump = fileSystem.CheckNumForFullName("sbarinfo/heretic.txt", true); + baselump = fileSystem.CheckNumForFullName("sbarinfo/heretic.txt"); } else if(sc.Compare("Hexen")) { - baselump = fileSystem.CheckNumForFullName("sbarinfo/hexen.txt", true); + baselump = fileSystem.CheckNumForFullName("sbarinfo/hexen.txt"); } else if(sc.Compare("Strife")) gameType = GAME_Strife; diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index cc9412f17..717ffcd0b 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -168,7 +168,7 @@ static void ReplaceSoundName(int index, const char* newname) if (snd == NO_SOUND) return; auto sfx = soundEngine->GetWritableSfx(snd); FStringf dsname("ds%s", newname); - sfx->lumpnum = fileSystem.CheckNumForName(dsname.GetChars(), FileSys::ns_sounds); + sfx->lumpnum = fileSystem.CheckNumForName(dsname.GetChars(), ns_sounds); sfx->bTentative = false; sfx->bRandomHeader = false; sfx->bLoadRAW = false; @@ -3205,7 +3205,7 @@ bool D_LoadDehFile(const char *patchfile, int flags) else { // Couldn't find it in the filesystem; try from a lump instead. - int lumpnum = fileSystem.CheckNumForFullName(patchfile, true); + int lumpnum = fileSystem.CheckNumForFullName(patchfile); if (lumpnum < 0) { // Compatibility fallback. It's just here because diff --git a/src/gamedata/decallib.cpp b/src/gamedata/decallib.cpp index 0f6e656b5..2d3888a2f 100644 --- a/src/gamedata/decallib.cpp +++ b/src/gamedata/decallib.cpp @@ -397,7 +397,7 @@ void FDecalLib::ParseDecal (FScanner &sc) case DECAL_PIC: sc.MustGetString (); picnum = TexMan.CheckForTexture (sc.String, ETextureType::Any); - if (!picnum.Exists() && (lumpnum = fileSystem.CheckNumForName (sc.String, FileSys::ns_graphics)) >= 0) + if (!picnum.Exists() && (lumpnum = fileSystem.CheckNumForName (sc.String, ns_graphics)) >= 0) { picnum = TexMan.CreateTexture (lumpnum, ETextureType::Decal); } diff --git a/src/gamedata/doomfont.h b/src/gamedata/doomfont.h index fedeb513c..b9d14db7d 100644 --- a/src/gamedata/doomfont.h +++ b/src/gamedata/doomfont.h @@ -18,7 +18,7 @@ void InitDoomFonts() if (fileSystem.CheckNumForName("FONTA_S") >= 0) { int wadfile = -1; - auto a = fileSystem.CheckNumForName("FONTA33", FileSys::ns_graphics); + auto a = fileSystem.CheckNumForName("FONTA33", ns_graphics); if (a != -1) wadfile = fileSystem.GetFileContainer(a); if (wadfile > fileSystem.GetIwadNum()) { @@ -32,10 +32,10 @@ void InitDoomFonts() SmallFont->SetCursor('['); } } - else if (fileSystem.CheckNumForName("STCFN033", FileSys::ns_graphics) >= 0) + else if (fileSystem.CheckNumForName("STCFN033", ns_graphics) >= 0) { int wadfile = -1; - auto a = fileSystem.CheckNumForName("STCFN065", FileSys::ns_graphics); + auto a = fileSystem.CheckNumForName("STCFN065", ns_graphics); if (a != -1) wadfile = fileSystem.GetFileContainer(a); if (wadfile > fileSystem.GetIwadNum()) { @@ -55,7 +55,7 @@ void InitDoomFonts() OriginalSmallFont = new FFont("OriginalSmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true); OriginalSmallFont->SetCursor('['); } - else if (fileSystem.CheckNumForName("STCFN033", FileSys::ns_graphics) >= 0) + else if (fileSystem.CheckNumForName("STCFN033", ns_graphics) >= 0) { OriginalSmallFont = new FFont("OriginalSmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, true, true); } @@ -63,7 +63,7 @@ void InitDoomFonts() if (!(SmallFont2 = V_GetFont("SmallFont2"))) // Only used by Strife { - if (fileSystem.CheckNumForName("STBFN033", FileSys::ns_graphics) >= 0) + if (fileSystem.CheckNumForName("STBFN033", ns_graphics) >= 0) { SmallFont2 = new FFont("SmallFont2", "STBFN%.3d", "defsmallfont2", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1); } diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 22981062b..dcd5fd7ee 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -941,7 +941,7 @@ void FMapInfoParser::ParseCluster() // Remap Hexen's CLUS?MSG lumps to the string table, if applicable. The code here only checks what can actually be in an IWAD. if (clusterinfo->flags & CLUSTER_EXITTEXTINLUMP) { - int lump = fileSystem.CheckNumForFullName(clusterinfo->ExitText.GetChars(), true); + int lump = fileSystem.CheckNumForAnyName(clusterinfo->ExitText.GetChars()); if (lump > 0) { // Check if this comes from either Hexen.wad or Hexdd.wad and if so, map to the string table. @@ -2447,7 +2447,7 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i if (sc.Compare("include")) { sc.MustGetString(); - int inclump = fileSystem.CheckNumForFullName(sc.String, true); + int inclump = fileSystem.CheckNumForAnyName(sc.String); if (inclump < 0) { sc.ScriptError("include file '%s' not found", sc.String); @@ -2725,7 +2725,7 @@ void G_ParseMapInfo (FString basemapinfo) // If that exists we need to skip this one. int wad = fileSystem.GetFileContainer(lump); - int altlump = fileSystem.CheckNumForName("ZMAPINFO", FileSys::ns_global, wad, true); + int altlump = fileSystem.CheckNumForName("ZMAPINFO", ns_global, wad, true); if (altlump >= 0) continue; } @@ -2733,9 +2733,9 @@ void G_ParseMapInfo (FString basemapinfo) { // MAPINFO and ZMAPINFO will override UMAPINFO if in the same WAD. int wad = fileSystem.GetFileContainer(lump); - int altlump = fileSystem.CheckNumForName("ZMAPINFO", FileSys::ns_global, wad, true); + int altlump = fileSystem.CheckNumForName("ZMAPINFO", ns_global, wad, true); if (altlump >= 0) continue; - altlump = fileSystem.CheckNumForName("MAPINFO", FileSys::ns_global, wad, true); + altlump = fileSystem.CheckNumForName("MAPINFO", ns_global, wad, true); if (altlump >= 0) continue; } if (nindex != 2) diff --git a/src/gamedata/textures/buildloader.cpp b/src/gamedata/textures/buildloader.cpp index d31d18ce4..ca55a8954 100644 --- a/src/gamedata/textures/buildloader.cpp +++ b/src/gamedata/textures/buildloader.cpp @@ -276,7 +276,7 @@ void InitBuildTiles() // only read from the same source as the palette. // The entire format here is just too volatile to allow liberal mixing. // An .ART set must be treated as one unit. - lumpnum = fileSystem.CheckNumForFullName(artpath.GetChars(), fileSystem.GetFileContainer(i)); + lumpnum = fileSystem.CheckNumForFullNameInFile(artpath.GetChars(), fileSystem.GetFileContainer(i)); if (lumpnum < 0) { break; diff --git a/src/gamedata/xlat/parsecontext.cpp b/src/gamedata/xlat/parsecontext.cpp index 0caa72f4b..1f0563aac 100644 --- a/src/gamedata/xlat/parsecontext.cpp +++ b/src/gamedata/xlat/parsecontext.cpp @@ -314,7 +314,7 @@ void FParseContext::ParseLump(const char *lumpname) const char *SavedSourceFile = SourceFile; FParseToken token; - int lumpno = fileSystem.CheckNumForFullName(lumpname, true); + int lumpno = fileSystem.CheckNumForAnyName(lumpname); if (lumpno == -1) { diff --git a/src/intermission/intermission_parse.cpp b/src/intermission/intermission_parse.cpp index d1089526b..c2c07dc31 100644 --- a/src/intermission/intermission_parse.cpp +++ b/src/intermission/intermission_parse.cpp @@ -303,7 +303,7 @@ bool FIntermissionActionTextscreen::ParseKey(FScanner &sc) { sc.MustGetToken('='); sc.MustGetToken(TK_StringConst); - int lump = fileSystem.CheckNumForFullName(sc.String, true); + int lump = fileSystem.CheckNumForAnyName(sc.String); bool done = false; if (lump > 0) { @@ -861,7 +861,7 @@ DIntermissionController* F_StartFinale (const char *music, int musicorder, int c FIntermissionActionTextscreen *textscreen = new FIntermissionActionTextscreen; if (textInLump) { - int lump = fileSystem.CheckNumForFullName(text, true); + int lump = fileSystem.CheckNumForAnyName(text); if (lump > 0) { textscreen->mText = GetStringFromLump(lump); diff --git a/src/maploader/edata.cpp b/src/maploader/edata.cpp index 044fb0811..3e89b7dfa 100644 --- a/src/maploader/edata.cpp +++ b/src/maploader/edata.cpp @@ -520,7 +520,7 @@ void MapLoader::InitED() FScanner sc; if (filename.IsEmpty()) return; - int lump = fileSystem.CheckNumForFullName(filename.GetChars(), true, FileSys::ns_global); + int lump = fileSystem.CheckNumForAnyName(filename.GetChars(), ns_global); if (lump == -1) return; sc.OpenLumpNum(lump); diff --git a/src/maploader/glnodes.cpp b/src/maploader/glnodes.cpp index 4768b838e..d61f95f8a 100644 --- a/src/maploader/glnodes.cpp +++ b/src/maploader/glnodes.cpp @@ -730,14 +730,14 @@ static int FindGLNodesInWAD(int labellump) glheader.Format("GL_%s", fileSystem.GetFileName(labellump)); if (glheader.Len()<=8) { - int gllabel = fileSystem.CheckNumForName(glheader.GetChars(), FileSys::ns_global, wadfile); + int gllabel = fileSystem.CheckNumForName(glheader.GetChars(), 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", FileSys::ns_global, wadfile); + int gllabel = fileSystem.CheckNumForName("GL_LEVEL", ns_global, wadfile); if (gllabel >= 0) { diff --git a/src/playsim/fragglescript/t_func.cpp b/src/playsim/fragglescript/t_func.cpp index f9fff1b9e..b543a4447 100644 --- a/src/playsim/fragglescript/t_func.cpp +++ b/src/playsim/fragglescript/t_func.cpp @@ -54,8 +54,6 @@ #include "s_music.h" #include "texturemanager.h" -using namespace FileSys; - static FRandom pr_script("FScript"); // functions. FParser::SF_ means Script Function not, well.. heh, me diff --git a/src/playsim/p_acs.cpp b/src/playsim/p_acs.cpp index d99663bde..95b1f5d37 100644 --- a/src/playsim/p_acs.cpp +++ b/src/playsim/p_acs.cpp @@ -1930,7 +1930,7 @@ void FBehaviorContainer::LoadDefaultModules () FScanner sc(lump); while (sc.GetString()) { - int acslump = fileSystem.CheckNumForName (sc.String, FileSys::ns_acslibrary); + int acslump = fileSystem.CheckNumForName (sc.String, ns_acslibrary); if (acslump >= 0) { LoadModule (acslump); @@ -2567,7 +2567,7 @@ bool FBehavior::Init(FLevelLocals *Level, int lumpnum, FileReader * fr, int len, if (parse[i]) { FBehavior *module = NULL; - int lump = fileSystem.CheckNumForName (&parse[i], FileSys::ns_acslibrary); + int lump = fileSystem.CheckNumForName (&parse[i], ns_acslibrary); if (lump < 0) { Printf (TEXTCOLOR_RED "Could not find ACS library %s.\n", &parse[i]); diff --git a/src/playsim/p_user.cpp b/src/playsim/p_user.cpp index 652d533ca..791dd847b 100644 --- a/src/playsim/p_user.cpp +++ b/src/playsim/p_user.cpp @@ -874,16 +874,16 @@ static int SetupCrouchSprite(AActor *self, int crouchsprite) FString normspritename = sprites[self->SpawnState->sprite].name; FString crouchspritename = sprites[crouchsprite].name; - int spritenorm = fileSystem.CheckNumForName((normspritename + "A1").GetChars(), FileSys::ns_sprites); + int spritenorm = fileSystem.CheckNumForName((normspritename + "A1").GetChars(), ns_sprites); if (spritenorm == -1) { - spritenorm = fileSystem.CheckNumForName((normspritename + "A0").GetChars(), FileSys::ns_sprites); + spritenorm = fileSystem.CheckNumForName((normspritename + "A0").GetChars(), ns_sprites); } - int spritecrouch = fileSystem.CheckNumForName((crouchspritename + "A1").GetChars(), FileSys::ns_sprites); + int spritecrouch = fileSystem.CheckNumForName((crouchspritename + "A1").GetChars(), ns_sprites); if (spritecrouch == -1) { - spritecrouch = fileSystem.CheckNumForName((crouchspritename + "A0").GetChars(), FileSys::ns_sprites); + spritecrouch = fileSystem.CheckNumForName((crouchspritename + "A0").GetChars(), ns_sprites); } if (spritenorm == -1 || spritecrouch == -1) diff --git a/src/r_data/colormaps.cpp b/src/r_data/colormaps.cpp index 4d9604b61..ad1559c6b 100644 --- a/src/r_data/colormaps.cpp +++ b/src/r_data/colormaps.cpp @@ -104,11 +104,11 @@ void R_InitColormaps (bool allowCustomColormap) for (uint32_t i = 0; i < NumLumps; i++) { - if (fileSystem.GetFileNamespace(i) == FileSys::ns_colormaps) + if (fileSystem.GetFileNamespace(i) == ns_colormaps) { auto name = fileSystem.GetFileShortName(i); - if (fileSystem.CheckNumForName (name, FileSys::ns_colormaps) == (int)i) + if (fileSystem.CheckNumForName (name, ns_colormaps) == (int)i) { strncpy(cm.name, name, 8); cm.blend = 0; diff --git a/src/r_data/gldefs.cpp b/src/r_data/gldefs.cpp index d92b9daf6..29774d3d1 100644 --- a/src/r_data/gldefs.cpp +++ b/src/r_data/gldefs.cpp @@ -134,7 +134,7 @@ static void ParseVavoomSkybox() sc.MustGetStringName("map"); sc.MustGetString(); - maplump = fileSystem.CheckNumForFullName(sc.String, true); + maplump = fileSystem.CheckNumForAnyName(sc.String); auto tex = TexMan.FindGameTexture(sc.String, ETextureType::Wall, FTextureManager::TEXMAN_TryAny); if (tex == NULL) @@ -1928,7 +1928,7 @@ public: { sc.MustGetString(); // This is not using sc.Open because it can print a more useful error message when done here - lump = fileSystem.CheckNumForFullName(sc.String, true); + lump = fileSystem.CheckNumForAnyName(sc.String); if (lump==-1) sc.ScriptError("Lump '%s' not found", sc.String); diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index a13d56998..0028966e0 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -1050,7 +1050,7 @@ void ParseModelDefLump(int Lump) { sc.MustGetString(); // This is not using sc.Open because it can print a more useful error message when done here - int includelump = fileSystem.CheckNumForFullName(sc.String, true); + int includelump = fileSystem.CheckNumForAnyName(sc.String); if (includelump == -1) { if (strcmp(sc.String, "sentinel.modl") != 0) // Gene Tech mod has a broken #include statement diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 8b197cda7..93bb023b8 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -783,7 +783,7 @@ void R_ParseTrnslate() do { sc.MustGetToken(TK_StringConst); - int pallump = fileSystem.CheckNumForFullName(sc.String, true, FileSys::ns_global); + int pallump = fileSystem.CheckNumForAnyName(sc.String, ns_global); if (pallump >= 0) // { int start = 0; diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index 0a7be96a1..963992321 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -349,7 +349,7 @@ void R_InitSpriteDefs () memset(vhashes.Data(), -1, sizeof(VHasher)*vmax); for (i = 0; i < vmax; ++i) { - if (fileSystem.GetFileNamespace(i) == FileSys::ns_voxels) + if (fileSystem.GetFileNamespace(i) == ns_voxels) { size_t namelen; int spin; @@ -715,7 +715,7 @@ void R_InitSkins (void) int lump = fileSystem.CheckNumForName (sc.String, Skins[i].namespc); if (lump == -1) { - lump = fileSystem.CheckNumForFullName (sc.String, true, FileSys::ns_sounds); + lump = fileSystem.CheckNumForAnyName (sc.String, ns_sounds); } if (lump != -1) { @@ -748,7 +748,7 @@ void R_InitSkins (void) sndlumps[j] = fileSystem.CheckNumForName (sc.String, Skins[i].namespc); if (sndlumps[j] == -1) { // Replacement not found, try finding it in the global namespace - sndlumps[j] = fileSystem.CheckNumForFullName (sc.String, true, FileSys::ns_sounds); + sndlumps[j] = fileSystem.CheckNumForAnyName (sc.String, ns_sounds); } } } @@ -946,7 +946,7 @@ CCMD (skins) static void R_CreateSkinTranslation (const char *palname) { - auto lump = fileSystem.ReadFile (palname); + auto lump = fileSystem.ReadFile (fileSystem.GetNumForName(palname)); auto otherPal = lump.bytes(); for (int i = 0; i < 256; ++i) @@ -1016,7 +1016,7 @@ void R_InitSprites () Skins[i].range0end = basetype->IntVar(NAME_ColorRangeEnd); Skins[i].Scale = basetype->Scale; Skins[i].sprite = basetype->SpawnState->sprite; - Skins[i].namespc = FileSys::ns_global; + Skins[i].namespc = ns_global; PlayerClasses[i].Skins.Push (i); diff --git a/src/r_data/v_palette.cpp b/src/r_data/v_palette.cpp index 8af454445..977206c78 100644 --- a/src/r_data/v_palette.cpp +++ b/src/r_data/v_palette.cpp @@ -44,8 +44,6 @@ #include "m_png.h" #include "v_colortables.h" -using namespace FileSys; - /* Current color blending values */ int BlendR, BlendG, BlendB, BlendA; @@ -64,7 +62,7 @@ void InitPalette () if (lump == -1) lump = fileSystem.CheckNumForName("COLORMAP", ns_colormaps); if (lump != -1) { - FileData cmap = fileSystem.ReadFile(lump); + auto cmap = fileSystem.ReadFile(lump); auto cmapdata = cmap.bytes(); GPalette.GenerateGlobalBrightmapFromColormap(cmapdata, 32); MakeGoodRemap((uint32_t*)GPalette.BaseColors, GPalette.Remap, cmapdata + 7936); // last entry in colormap diff --git a/src/r_data/voxeldef.cpp b/src/r_data/voxeldef.cpp index a2eee3c35..14f3c8db1 100644 --- a/src/r_data/voxeldef.cpp +++ b/src/r_data/voxeldef.cpp @@ -50,8 +50,6 @@ #include "g_level.h" #include "r_data/sprites.h" -using namespace FileSys; - struct VoxelOptions { int DroppedSpin = 0; @@ -282,7 +280,7 @@ void R_InitVoxels() sc.SetCMode(true); sc.MustGetToken(TK_StringConst); - voxelfile = fileSystem.CheckNumForFullName(sc.String, true, ns_voxels); + voxelfile = fileSystem.CheckNumForAnyName(sc.String, ns_voxels); if (voxelfile < 0) { sc.ScriptMessage("Voxel \"%s\" not found.\n", sc.String); diff --git a/src/rendering/swrenderer/r_swcolormaps.cpp b/src/rendering/swrenderer/r_swcolormaps.cpp index 1ff95c8b3..b22895485 100644 --- a/src/rendering/swrenderer/r_swcolormaps.cpp +++ b/src/rendering/swrenderer/r_swcolormaps.cpp @@ -346,9 +346,9 @@ void SetDefaultColormap (const char *name) uint8_t unremap[256]; uint8_t remap[256]; - lump = fileSystem.CheckNumForFullName (name, true, FileSys::ns_colormaps); + lump = fileSystem.CheckNumForAnyName (name, ns_colormaps); if (lump == -1) - lump = fileSystem.CheckNumForName (name, FileSys::ns_global); + lump = fileSystem.CheckNumForName (name, ns_global); // [RH] If using BUILD's palette, generate the colormap if (lump == -1 || fileSystem.CheckNumForFullName("palette.dat") >= 0 || fileSystem.CheckNumForFullName("blood.pal") >= 0) diff --git a/src/scripting/decorate/thingdef_parse.cpp b/src/scripting/decorate/thingdef_parse.cpp index 03a249814..53d8ea9b7 100644 --- a/src/scripting/decorate/thingdef_parse.cpp +++ b/src/scripting/decorate/thingdef_parse.cpp @@ -1282,7 +1282,7 @@ void ParseDecorate (FScanner &sc, PNamespace *ns) // This check needs to remain overridable for testing purposes. if (fileSystem.GetFileContainer(sc.LumpNum) == 0 && !Args->CheckParm("-allowdecoratecrossincludes")) { - int includefile = fileSystem.GetFileContainer(fileSystem.CheckNumForFullName(sc.String, true)); + int includefile = fileSystem.GetFileContainer(fileSystem.CheckNumForAnyName(sc.String)); if (includefile != 0) { I_FatalError("File %s is overriding core lump %s.", diff --git a/src/sound/s_advsound.cpp b/src/sound/s_advsound.cpp index 8717c4b9e..1af1ddb1d 100644 --- a/src/sound/s_advsound.cpp +++ b/src/sound/s_advsound.cpp @@ -51,8 +51,6 @@ #include "s_music.h" #include "i_music.h" -using namespace FileSys; - // MACROS ------------------------------------------------------------------ #define RANDOM 1 @@ -416,7 +414,7 @@ DEFINE_ACTION_FUNCTION(DObject,S_GetLength) FSoundID S_AddSound (const char *logicalname, const char *lumpname, FScanner *sc) { - int lump = fileSystem.CheckNumForFullName (lumpname, true, ns_sounds); + int lump = fileSystem.CheckNumForAnyName (lumpname, ns_sounds); return S_AddSound (logicalname, lump); } @@ -482,7 +480,7 @@ FSoundID S_AddPlayerSound (const char *pclass, int gender, FSoundID refid, const if (lumpname) { - lump = fileSystem.CheckNumForFullName (lumpname, true, ns_sounds); + lump = fileSystem.CheckNumForAnyName (lumpname, ns_sounds); } return S_AddPlayerSound (pclass, gender, refid, lump); @@ -1071,7 +1069,7 @@ static void S_AddSNDINFO (int lump) FName mapped = sc.String; // only set the alias if the lump it maps to exists. - if (mapped == NAME_None || fileSystem.CheckNumForFullName(sc.String, true, ns_music) >= 0) + if (mapped == NAME_None || fileSystem.CheckNumForAnyName(sc.String, ns_music) >= 0) { MusicAliases[alias] = mapped; } diff --git a/src/sound/s_doomsound.cpp b/src/sound/s_doomsound.cpp index 749b1f5e7..22f99201d 100644 --- a/src/sound/s_doomsound.cpp +++ b/src/sound/s_doomsound.cpp @@ -186,7 +186,7 @@ static FString LookupMusic(const char* musicname, int& order) static int FindMusic(const char* musicname) { int lumpnum = fileSystem.CheckNumForFullName(musicname); - if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, FileSys::ns_music); + if (lumpnum == -1) lumpnum = fileSystem.CheckNumForName(musicname, ns_music); return lumpnum; } @@ -295,7 +295,7 @@ void S_Start() if (LocalSndInfo.IsNotEmpty()) { // Now parse the local SNDINFO - int j = fileSystem.CheckNumForFullName(LocalSndInfo.GetChars(), true); + int j = fileSystem.CheckNumForAnyName(LocalSndInfo.GetChars()); if (j >= 0) S_AddLocalSndInfo(j); } @@ -309,7 +309,7 @@ void S_Start() if (parse_ss) { - S_ParseSndSeq(LocalSndSeq.IsNotEmpty() ? fileSystem.CheckNumForFullName(LocalSndSeq.GetChars(), true) : -1); + S_ParseSndSeq(LocalSndSeq.IsNotEmpty() ? fileSystem.CheckNumForAnyName(LocalSndSeq.GetChars()) : -1); } LastLocalSndInfo = LocalSndInfo; diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 3af0a7829..53d079318 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -517,7 +517,7 @@ bool DInterBackground::LoadBackground(bool isenterpic) { try { - int lumpnum = fileSystem.CheckNumForFullName(lumpname, true); + int lumpnum = fileSystem.CheckNumForAnyName(lumpname); if (lumpnum == -1) { I_Error("Intermission animation lump %s not found!", lumpname); @@ -757,7 +757,7 @@ bool DInterBackground::LoadBackground(bool isenterpic) } else { - int lumpnum = fileSystem.CheckNumForFullName(lumpname + 1, true); + int lumpnum = fileSystem.CheckNumForAnyName(lumpname + 1); if (lumpnum >= 0) { FScanner sc(lumpnum);