diff --git a/project/code/LGS/Database/Chunks/Property.cs b/project/code/LGS/Database/Chunks/Property.cs index 410a3c1..3777422 100644 --- a/project/code/LGS/Database/Chunks/Property.cs +++ b/project/code/LGS/Database/Chunks/Property.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Numerics; using System.Text; namespace KeepersCompound.LGS.Database.Chunks; @@ -34,6 +35,40 @@ public class PropertyModelName : IChunk } } + public void WriteData(BinaryWriter writer) + { + 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 properties; + + public void ReadData(BinaryReader reader, DbFile.TableOfContents.Entry entry) + { + properties = new List(); + while (reader.BaseStream.Position < entry.Offset + entry.Size + 24) + { + properties.Add(new Property(reader)); + } + } + public void WriteData(BinaryWriter writer) { throw new System.NotImplementedException(); diff --git a/project/code/LGS/Database/File.cs b/project/code/LGS/Database/File.cs index 072d3ab..904ef44 100644 --- a/project/code/LGS/Database/File.cs +++ b/project/code/LGS/Database/File.cs @@ -103,6 +103,7 @@ public class DbFile "WREXT" => new WorldRep(), "BRLIST" => new BrList(), "P$ModelName" => new PropertyModelName(), + "P$Scale" => new PropertyScale(), "LD$MetaProp" => new LinkDataMetaProp(), _ when entryName.StartsWith("L$") => new LinkChunk(), _ => new GenericChunk(),