backend update from GZDoom

This commit is contained in:
Christoph Oelckers 2024-01-04 18:24:00 +01:00
parent fb6beb905a
commit 52b3d386cf
5 changed files with 16 additions and 14 deletions

View file

@ -266,7 +266,7 @@ if( MSVC )
# String pooling
# Function-level linking
# Disable run-time type information
set( ALL_C_FLAGS "/GF /Gy /permissive-" )
set( ALL_C_FLAGS "/GF /Gy /permissive- /utf-8" )
if ( HAVE_VULKAN )
set( ALL_C_FLAGS "${ALL_C_FLAGS} /DHAVE_VULKAN" )

View file

@ -242,12 +242,12 @@ bool F7ZFile::Open(LumpFilterInfo *filter, FileSystemMessageFunc Printf)
std::u16string nameUTF16;
std::vector<char> nameASCII;
uint32_t j = 0;
for (uint32_t i = 0; i < NumLumps; ++i)
{
// skip Directories
if (SzArEx_IsDir(archPtr, i))
{
skipped++;
continue;
}
@ -255,7 +255,6 @@ bool F7ZFile::Open(LumpFilterInfo *filter, FileSystemMessageFunc Printf)
if (0 == nameLength)
{
++skipped;
continue;
}
@ -265,16 +264,17 @@ bool F7ZFile::Open(LumpFilterInfo *filter, FileSystemMessageFunc Printf)
SzArEx_GetFileNameUtf16(archPtr, i, (UInt16*)nameUTF16.data());
utf16_to_utf8((uint16_t*)nameUTF16.data(), nameASCII);
Entries[i].FileName = NormalizeFileName(nameASCII.data());
Entries[i].Length = SzArEx_GetFileSize(archPtr, i);
Entries[i].Flags = RESFF_FULLPATH|RESFF_COMPRESSED;
Entries[i].ResourceID = -1;
Entries[i].Namespace = ns_global;
Entries[i].Method = METHOD_INVALID;
Entries[i].Position = i;
Entries[j].FileName = NormalizeFileName(nameASCII.data());
Entries[j].Length = SzArEx_GetFileSize(archPtr, i);
Entries[j].Flags = RESFF_FULLPATH|RESFF_COMPRESSED;
Entries[j].ResourceID = -1;
Entries[j].Namespace = ns_global;
Entries[j].Method = METHOD_INVALID;
Entries[j].Position = i;
j++;
}
// Resize the lump record array to its actual size
NumLumps -= skipped;
NumLumps = j;
if (NumLumps > 0)
{

View file

@ -391,10 +391,10 @@ void FileSystem::AddFile (const char *filename, FileReader *filer, LumpFilterInf
int flags = resfile->GetEntryFlags(i);
if (flags & RESFF_EMBEDDED)
{
auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE);
std::string path = filename;
if (embedded.GetBuffer()) path += ':';
path += ':';
path += resfile->getName(i);
auto embedded = resfile->GetEntryReader(i, READER_NEW, READERFLAG_SEEKABLE);
AddFile(path.c_str(), &embedded, filter, Printf, hashfile);
}
}

View file

@ -329,6 +329,8 @@ void FResourceFile::GenerateHash()
{
auto name = getName(i);
auto size = Length(i);
if (name == nullptr)
continue;
md5_append(&state, (const uint8_t*)name, (unsigned)strlen(name) + 1);
md5_append(&state, (const uint8_t*)&size, sizeof(size));
}

View file

@ -1441,7 +1441,7 @@ public:
//==========================================================================
//
// FxGlobalVariaböe
// FxGlobalVariable
//
//==========================================================================