summaryrefslogtreecommitdiff
path: root/NW4RTools/BrresReader.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-11 04:33:24 +0100
committerTreeki <treeki@gmail.com>2011-02-11 04:33:24 +0100
commitf6f657812c1973172d25d7895aabb37f900071a7 (patch)
tree29797b41f60113373fc7e83493bcbee72dfbfc88 /NW4RTools/BrresReader.cs
parent0d017deb24e7f6f8e049616a71691f1401c50b6a (diff)
downloadnw4rtools-f6f657812c1973172d25d7895aabb37f900071a7.tar.gz
nw4rtools-f6f657812c1973172d25d7895aabb37f900071a7.zip
lots of progress. semi-working Wavefront OBJ exporter
Diffstat (limited to '')
-rw-r--r--NW4RTools/BrresReader.cs11
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;