take namespace enum out of namespace and added CheckNumForAnyName and CheckNumForFullNameInFile to clarify the meaning of CheckNumForFullName.

This is to take some renaming noise out of the upcoming refactoring.
This commit is contained in:
Christoph Oelckers 2024-11-24 13:18:46 +01:00
commit 634a646c2d
51 changed files with 118 additions and 122 deletions

View file

@ -124,7 +124,7 @@ FScanner::FScanner(int lumpnum, TMap<FName, Symbol>* 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);

View file

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

View file

@ -47,7 +47,7 @@
//
//==========================================================================
void FStringTable::LoadStrings (FileSys::FileSystem& fileSystem, const char *language)
void FStringTable::LoadStrings (FileSystem& fileSystem, const char *language)
{
int lastlump, lump;

View file

@ -84,7 +84,7 @@ public:
using LangMap = TMap<uint32_t, StringMap>;
using StringMacroMap = TMap<FName, StringMacro>;
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)