Add scale property support

This commit is contained in:
Jarrod Doyle 2024-08-25 11:53:50 +01:00
parent 655a188a69
commit 505adf5d44
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 36 additions and 0 deletions

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Numerics;
using System.Text; using System.Text;
namespace KeepersCompound.LGS.Database.Chunks; namespace KeepersCompound.LGS.Database.Chunks;
@ -39,3 +40,37 @@ public class PropertyModelName : IChunk
throw new System.NotImplementedException(); throw new System.NotImplementedException();
} }
} }
public class PropertyScale : IChunk
{
public record Property
{
public int objectId;
public int length;
public Vector3 scale;
public Property(BinaryReader reader)
{
objectId = reader.ReadInt32();
length = (int)reader.ReadUInt32();
scale = reader.ReadVec3();
}
}
public ChunkHeader Header { get; set; }
public List<Property> properties;
public void ReadData(BinaryReader reader, DbFile.TableOfContents.Entry entry)
{
properties = new List<Property>();
while (reader.BaseStream.Position < entry.Offset + entry.Size + 24)
{
properties.Add(new Property(reader));
}
}
public void WriteData(BinaryWriter writer)
{
throw new System.NotImplementedException();
}
}

View File

@ -103,6 +103,7 @@ public class DbFile
"WREXT" => new WorldRep(), "WREXT" => new WorldRep(),
"BRLIST" => new BrList(), "BRLIST" => new BrList(),
"P$ModelName" => new PropertyModelName(), "P$ModelName" => new PropertyModelName(),
"P$Scale" => new PropertyScale(),
"LD$MetaProp" => new LinkDataMetaProp(), "LD$MetaProp" => new LinkDataMetaProp(),
_ when entryName.StartsWith("L$") => new LinkChunk(), _ when entryName.StartsWith("L$") => new LinkChunk(),
_ => new GenericChunk(), _ => new GenericChunk(),