Add scale property support
This commit is contained in:
		
							parent
							
								
									655a188a69
								
							
						
					
					
						commit
						505adf5d44
					
				|  | @ -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<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(); | ||||
|  |  | |||
|  | @ -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(), | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue