Optimize prepared asset package v2
This commit is contained in:
parent
d123c4b67c
commit
0dd966f3a0
28 changed files with 1277 additions and 106 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue