public static Formats.Materials.Matl ParseMatl(this SsbhParser parser) { var result = new Formats.Materials.Matl(); result.Magic = parser.ReadUInt32(); result.MajorVersion = parser.ReadInt16(); result.MinorVersion = parser.ReadInt16(); { // TODO: Extract this code to a method? long absoluteOffset = parser.ReadRelativeGetAbsoluteOffset(); long elementCount = parser.ReadInt64(); long previousPosition = parser.Position; parser.Seek(absoluteOffset); result.Entries = new Formats.Materials.MatlEntry[elementCount]; for (int i = 0; i < elementCount; i++) { result.Entries[i] = parser.ParseMatlEntry(); } parser.Seek(previousPosition); } return(result); }
public static Formats.SkelBoneEntry ParseSkelBoneEntry(this SsbhParser parser) { var result = new Formats.SkelBoneEntry(); result.Name = parser.ReadOffsetReadString(); result.Id = parser.ReadInt16(); result.ParentId = parser.ReadInt16(); result.Type = parser.ReadInt32(); return(result); }