mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
pre shot
This commit is contained in:
parent
543ce7faeb
commit
d7751d6f95
|
|
@ -328,6 +328,17 @@ namespace FModel.PakReader.Pak
|
|||
uint Value = BitConverter.ToUInt32(encodedPakEntries, pakLocation);
|
||||
pakLocation += sizeof(uint);
|
||||
|
||||
if ((Value & 0x3f) == 0x3f) // flag value to load a field
|
||||
{
|
||||
CompressionBlockSize = BitConverter.ToUInt32(encodedPakEntries, pakLocation);
|
||||
pakLocation += sizeof(uint);
|
||||
}
|
||||
else
|
||||
{
|
||||
// for backwards compatibility with old paks :
|
||||
CompressionBlockSize = (Value & 0x3f) << 11;
|
||||
}
|
||||
|
||||
CompressionMethodIndex = ((Value >> 23) & 0x3f);
|
||||
|
||||
// Test for 32-bit safe values. Grab it, or memcpy the 64-bit value
|
||||
|
|
@ -392,11 +403,8 @@ namespace FModel.PakReader.Pak
|
|||
FPakCompressedBlock[] CompressionBlocks = new FPakCompressedBlock[CompressionBlocksCount];
|
||||
|
||||
// Filter the compression block size or use the UncompressedSize if less that 64k.
|
||||
CompressionBlockSize = 0;
|
||||
if (CompressionBlocksCount > 0)
|
||||
{
|
||||
CompressionBlockSize = UncompressedSize < 65536 ? (uint)UncompressedSize : ((Value & 0x3f) << 11);
|
||||
}
|
||||
if (CompressionBlocksCount > 0 && UncompressedSize < 65536)
|
||||
CompressionBlockSize = (uint)UncompressedSize;
|
||||
|
||||
// Set bDeleteRecord to false, because it obviously isn't deleted if we are here.
|
||||
Deleted = false;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ namespace FModel.PakReader.Parsers.Class
|
|||
|
||||
private void Serialize(PackageReader reader, Stream ubulk, long ubulkOffset)
|
||||
{
|
||||
bStreaming = FModel.Globals.Game.Version >= EPakVersion.PATH_HASH_INDEX;
|
||||
bCooked = reader.ReadInt32() != 0;
|
||||
if (this.TryGetValue("bStreaming", out var v) && v is BoolProperty b)
|
||||
bStreaming = b.Value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user