Optimize prepared asset package v2

This commit is contained in:
Erik 2026-08-27 20:09:09 +02:00
parent d123c4b67c
commit 0dd966f3a0
28 changed files with 1277 additions and 106 deletions

View file

@ -50,7 +50,7 @@ public class PakRoundTripTests : IDisposable {
private static PakHeader WritePak(string path, (PakAssetType Type, uint FileId, ObjectMeshData Data)[] blobs) {
var header = new PakHeader {
FormatVersion = 1,
FormatVersion = PakFormat.CurrentFormatVersion,
PortalIteration = 10,
CellIteration = 20,
HighResIteration = 30,
@ -231,7 +231,8 @@ public class PakRoundTripTests : IDisposable {
[Theory]
[InlineData(0u)]
[InlineData(2u)]
[InlineData(1u)]
[InlineData(3u)]
public void Reader_RejectsWrongFormatVersion(uint wrongVersion) {
var path = NewTempPakPath();
WritePak(path, MakeBlobSet(2));
@ -339,7 +340,7 @@ public class PakRoundTripTests : IDisposable {
// Recompute CRC over the tampered blob region.
fs.Position = (long)entry.Offset;
var blobBytes = new byte[entry.Length];
var blobBytes = new byte[entry.StoredLength];
fs.ReadExactly(blobBytes);
uint newCrc = Crc32.Compute(blobBytes);