mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 00:42:08 +00:00
backend update from GZDoom
This commit is contained in:
parent
fb6beb905a
commit
52b3d386cf
5 changed files with 16 additions and 14 deletions
|
@ -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" )
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -1441,7 +1441,7 @@ public:
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// FxGlobalVariaböe
|
||||
// FxGlobalVariable
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
|
Loading…
Reference in a new issue