- rename File_Name back.

This commit is contained in:
Christoph Oelckers 2023-08-22 19:56:38 +02:00
parent 8e250abe0a
commit 929cae2f41
8 changed files with 32 additions and 32 deletions

View File

@ -227,7 +227,7 @@ bool F7ZFile::Open(LumpFilterInfo *filter, FileSystemMessageFunc Printf)
Archive = NULL;
if (res == SZ_ERROR_UNSUPPORTED)
{
Printf(FSMessageLevel::Error, "%s: Decoder does not support this archive\n", File_Name);
Printf(FSMessageLevel::Error, "%s: Decoder does not support this archive\n", FileName);
}
else if (res == SZ_ERROR_MEM)
{
@ -300,7 +300,7 @@ bool F7ZFile::Open(LumpFilterInfo *filter, FileSystemMessageFunc Printf)
if (SZ_OK != Archive->Extract(Lumps[0].Position, &temp[0]))
{
Printf(FSMessageLevel::Error, "%s: unsupported 7z/LZMA file!\n", File_Name);
Printf(FSMessageLevel::Error, "%s: unsupported 7z/LZMA file!\n", FileName);
return false;
}
}

View File

@ -94,7 +94,7 @@ FDirectory::FDirectory(const char * directory, StringPool* sp, bool nosubdirflag
{
auto fn = FS_FullPath(directory);
if (fn.back() != '/') fn += '/';
File_Name = sp->Strdup(fn.c_str());
FileName = sp->Strdup(fn.c_str());
}
//==========================================================================
@ -150,7 +150,7 @@ int FDirectory::AddDirectory(const char *dirpath, LumpFilterInfo* filter, FileSy
bool FDirectory::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
{
NumLumps = AddDirectory(File_Name, filter, Printf);
NumLumps = AddDirectory(FileName, filter, Printf);
PostProcessArchive(&Lumps[0], sizeof(FDirectoryLump), filter);
return true;
}
@ -169,7 +169,7 @@ void FDirectory::AddEntry(const char *fullpath, int size)
lump_p->mFullPath = fullpath;
// [mxd] Convert name to lowercase
std::string name = fullpath + strlen(File_Name);
std::string name = fullpath + strlen(FileName);
for (auto& c : name) c = tolower(c);
// The lump's name is only the part relative to the main directory

View File

@ -68,7 +68,7 @@ FLumpFile::FLumpFile(const char *filename, FileReader &file, StringPool* sp)
bool FLumpFile::Open(LumpFilterInfo*)
{
Lumps.Resize(1);
Lumps[0].LumpNameSetup(ExtractBaseName(File_Name, true).c_str(), stringpool);
Lumps[0].LumpNameSetup(ExtractBaseName(FileName, true).c_str(), stringpool);
Lumps[0].Owner = this;
Lumps[0].Position = 0;
Lumps[0].LumpSize = (int)Reader.GetLength();

View File

@ -183,7 +183,7 @@ bool FWadFile::Open(LumpFilterInfo*, FileSystemMessageFunc Printf)
// Check again to detect broken wads
if (InfoTableOfs + NumLumps*sizeof(wadlump_t) > (unsigned)wadSize)
{
Printf(FSMessageLevel::Error, "%s: Bad directory offset.\n", File_Name);
Printf(FSMessageLevel::Error, "%s: Bad directory offset.\n", FileName);
return false;
}
}
@ -220,7 +220,7 @@ bool FWadFile::Open(LumpFilterInfo*, FileSystemMessageFunc Printf)
{
if (Lumps[i].LumpSize != 0)
{
Printf(FSMessageLevel::Warning, "%s: Lump %s contains invalid positioning info and will be ignored\n", File_Name, Lumps[i].getName());
Printf(FSMessageLevel::Warning, "%s: Lump %s contains invalid positioning info and will be ignored\n", FileName, Lumps[i].getName());
Lumps[i].clearName();
}
Lumps[i].LumpSize = Lumps[i].Position = 0;
@ -305,7 +305,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
{
if (numendmarkers == 0) return; // no markers found
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", File_Name, endmarker, startmarker);
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", FileName, endmarker, startmarker);
if (flathack)
@ -319,7 +319,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", File_Name, Lumps[ii].getName());
Printf(FSMessageLevel::DebugNotify, "%s: Marking %s as potential flat\n", FileName, Lumps[ii].getName());
Lumps[ii].Flags |= LUMPF_MAYBEFLAT;
}
}
@ -333,7 +333,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
int start, end;
if (markers[i].markertype != 0)
{
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", File_Name, endmarker, startmarker);
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", FileName, endmarker, startmarker);
i++;
continue;
}
@ -342,21 +342,21 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
// skip over subsequent x_START markers
while (i < markers.Size() && markers[i].markertype == 0)
{
Printf(FSMessageLevel::Warning, "%s: duplicate %s marker found.\n", File_Name, startmarker);
Printf(FSMessageLevel::Warning, "%s: duplicate %s marker found.\n", FileName, startmarker);
i++;
continue;
}
// same for x_END markers
while (i < markers.Size()-1 && (markers[i].markertype == 1 && markers[i+1].markertype == 1))
{
Printf(FSMessageLevel::Warning, "%s: duplicate %s marker found.\n", File_Name, endmarker);
Printf(FSMessageLevel::Warning, "%s: duplicate %s marker found.\n", FileName, endmarker);
i++;
continue;
}
// We found a starting marker but no end marker. Ignore this block.
if (i >= markers.Size())
{
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", File_Name, startmarker, endmarker);
Printf(FSMessageLevel::Warning, "%s: %s marker without corresponding %s found.\n", FileName, startmarker, endmarker);
end = NumLumps;
}
else
@ -365,14 +365,14 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
}
// we found a marked block
Printf(FSMessageLevel::DebugNotify, "%s: Found %s block at (%d-%d)\n", File_Name, startmarker, markers[start].index, end);
Printf(FSMessageLevel::DebugNotify, "%s: Found %s block at (%d-%d)\n", FileName, startmarker, markers[start].index, end);
for(int j = markers[start].index + 1; j < end; j++)
{
if (Lumps[j].Namespace != ns_global)
{
if (!warned)
{
Printf(FSMessageLevel::Warning, "%s: Overlapping namespaces found (lump %d)\n", File_Name, j);
Printf(FSMessageLevel::Warning, "%s: Overlapping namespaces found (lump %d)\n", FileName, j);
}
warned = true;
}
@ -382,7 +382,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name
// ignore sprite lumps smaller than 8 bytes (the smallest possible)
// in size -- this was used by some dmadds wads
// as an 'empty' graphics resource
Printf(FSMessageLevel::DebugWarn, "%s: Skipped empty sprite %s (lump %d)\n", File_Name, Lumps[j].getName(), j);
Printf(FSMessageLevel::DebugWarn, "%s: Skipped empty sprite %s (lump %d)\n", FileName, Lumps[j].getName(), j);
}
else
{
@ -452,7 +452,7 @@ void FWadFile::SkinHack (FileSystemMessageFunc Printf)
}
if (skinned && hasmap)
{
Printf(FSMessageLevel::Attention, "%s: The maps will not be loaded because it has a skin.\n", File_Name);
Printf(FSMessageLevel::Attention, "%s: The maps will not be loaded because it has a skin.\n", FileName);
Printf(FSMessageLevel::Attention, "You should remove the skin from the wad to play these maps.\n");
}
}

View File

@ -180,7 +180,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (centraldir == 0)
{
Printf(FSMessageLevel::Error, "%s: ZIP file corrupt!\n", File_Name);
Printf(FSMessageLevel::Error, "%s: ZIP file corrupt!\n", FileName);
return false;
}
@ -196,7 +196,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (info.NumEntries != info.NumEntriesOnAllDisks ||
info.FirstDisk != 0 || info.DiskNumber != 0)
{
Printf(FSMessageLevel::Error, "%s: Multipart Zip files are not supported.\n", File_Name);
Printf(FSMessageLevel::Error, "%s: Multipart Zip files are not supported.\n", FileName);
return false;
}
@ -215,7 +215,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (info.NumEntries != info.NumEntriesOnAllDisks ||
info.FirstDisk != 0 || info.DiskNumber != 0)
{
Printf(FSMessageLevel::Error, "%s: Multipart Zip files are not supported.\n", File_Name);
Printf(FSMessageLevel::Error, "%s: Multipart Zip files are not supported.\n", FileName);
return false;
}
@ -254,7 +254,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (dirptr > ((char*)directory) + dirsize) // This directory entry goes beyond the end of the file.
{
free(directory);
Printf(FSMessageLevel::Error, "%s: Central directory corrupted.", File_Name);
Printf(FSMessageLevel::Error, "%s: Central directory corrupted.", FileName);
return false;
}
@ -323,7 +323,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (dirptr > ((char*)directory) + dirsize) // This directory entry goes beyond the end of the file.
{
free(directory);
Printf(FSMessageLevel::Error, "%s: Central directory corrupted.", File_Name);
Printf(FSMessageLevel::Error, "%s: Central directory corrupted.", FileName);
return false;
}
@ -350,7 +350,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
zip_fh->Method != METHOD_IMPLODE &&
zip_fh->Method != METHOD_SHRINK)
{
Printf(FSMessageLevel::Error, "%s: '%s' uses an unsupported compression algorithm (#%d).\n", File_Name, name.c_str(), zip_fh->Method);
Printf(FSMessageLevel::Error, "%s: '%s' uses an unsupported compression algorithm (#%d).\n", FileName, name.c_str(), zip_fh->Method);
skipped++;
continue;
}
@ -358,7 +358,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
zip_fh->Flags = LittleShort(zip_fh->Flags);
if (zip_fh->Flags & ZF_ENCRYPTED)
{
Printf(FSMessageLevel::Error, "%s: '%s' is encrypted. Encryption is not supported.\n", File_Name, name.c_str());
Printf(FSMessageLevel::Error, "%s: '%s' is encrypted. Encryption is not supported.\n", FileName, name.c_str());
skipped++;
continue;
}
@ -385,7 +385,7 @@ bool FZipFile::Open(LumpFilterInfo* filter, FileSystemMessageFunc Printf)
if (zip_64->CompressedSize > 0x7fffffff || zip_64->UncompressedSize > 0x7fffffff)
{
// The file system is limited to 32 bit file sizes;
Printf(FSMessageLevel::Warning, "%s: '%s' is too large.\n", File_Name, name.c_str());
Printf(FSMessageLevel::Warning, "%s: '%s' is too large.\n", FileName, name.c_str());
skipped++;
continue;
}

View File

@ -1418,7 +1418,7 @@ const char *FileSystem::GetResourceFileName (int rfnum) const noexcept
return NULL;
}
name = Files[rfnum]->File_Name;
name = Files[rfnum]->FileName;
slash = strrchr (name, '/');
return (slash != nullptr && slash[1] != 0) ? slash+1 : name;
}
@ -1484,7 +1484,7 @@ const char *FileSystem::GetResourceFileFullName (int rfnum) const noexcept
return nullptr;
}
return Files[rfnum]->File_Name;
return Files[rfnum]->FileName;
}

View File

@ -154,7 +154,7 @@ static bool IsWadInFolder(const FResourceFile* const archive, const char* const
return false;
}
const auto dirName = ExtractBaseName(archive->File_Name);
const auto dirName = ExtractBaseName(archive->FileName);
const auto fileName = ExtractBaseName(resPath, true);
const std::string filePath = dirName + '/' + fileName;
@ -239,7 +239,7 @@ void *FResourceLump::Lock()
catch (const FileSystemException& err)
{
// enrich the message with info about this lump.
throw FileSystemException("%s, file '%s': %s", getName(), Owner->File_Name, err.what());
throw FileSystemException("%s, file '%s': %s", getName(), Owner->FileName, err.what());
}
}
return Cache;
@ -330,7 +330,7 @@ FResourceFile *FResourceFile::OpenDirectory(const char *filename, LumpFilterInfo
FResourceFile::FResourceFile(const char *filename, StringPool* sp)
{
stringpool = sp ? sp : new StringPool;
File_Name = stringpool->Strdup(filename);
FileName = stringpool->Strdup(filename);
}
FResourceFile::FResourceFile(const char *filename, FileReader &r, StringPool* sp)

View File

@ -156,7 +156,7 @@ class FResourceFile
{
public:
FileReader Reader;
const char* File_Name;
const char* FileName;
protected:
uint32_t NumLumps;
char Hash[48];