diff options
Diffstat (limited to '')
-rw-r--r-- | NW4RTools/BrresReader.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/NW4RTools/BrresReader.cs b/NW4RTools/BrresReader.cs index 49f2edb..288ff1e 100644 --- a/NW4RTools/BrresReader.cs +++ b/NW4RTools/BrresReader.cs @@ -340,6 +340,8 @@ namespace NW4RTools { private void LoadVertexDataBase(InputStream ins, Models.VertexDataBase n) { + int startPos = ins.Position; + UInt32 size = ins.ReadUInt32(); Int32 mdlOffset = ins.ReadInt32(); @@ -349,13 +351,18 @@ namespace NW4RTools { // Note: we're relying on this value to be correct, for Shape mappings n.Index = ins.ReadUInt32(); - n.ComponentCount = (CompCount)ins.ReadUInt32(); - n.ComponentType = (CompType)ins.ReadUInt32(); + n.ComponentCount = (VertexSettings.CompCount)ins.ReadUInt32(); + n.ComponentType = (VertexSettings.CompType)ins.ReadUInt32(); n.Fraction = ins.ReadByte(); n.EntrySize = ins.ReadByte(); n.EntryCount = ins.ReadUInt16(); + int structEndPos = ins.Position; + + ins.Seek(startPos + dataOffset); n.Data = ins.ReadBytes(n.EntrySize * n.EntryCount); + + ins.Seek(structEndPos); } private Dictionary<int, Models.VertexPosData> VtxPosIndexLookup; |