From b0760b28807b31cc1403584265c07feb87ac4887 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 18 Feb 2011 03:28:31 +0100 Subject: some collada work, and an unfinished OGL renderer using OpenTK. huge commit --- NW4RTools/BrresReader.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'NW4RTools/BrresReader.cs') diff --git a/NW4RTools/BrresReader.cs b/NW4RTools/BrresReader.cs index 71dacc3..8b48ef3 100644 --- a/NW4RTools/BrresReader.cs +++ b/NW4RTools/BrresReader.cs @@ -427,14 +427,23 @@ namespace NW4RTools { n.ComponentCount = (VertexSettings.CompCount)ins.ReadUInt32(); n.ComponentType = (VertexSettings.CompType)ins.ReadUInt32(); - n.Fraction = ins.ReadByte(); - n.EntrySize = ins.ReadByte(); + + // ridiculous and hacky. thanks for requiring this, Nintendo + if (n is VertexClrData) { + n.EntrySize = ins.ReadByte(); + ins.Skip(1); + } else { + 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); + n.RawData = ins.ReadBytes(n.EntrySize * n.EntryCount); + n.Parse(); ins.Seek(structEndPos); } @@ -805,8 +814,8 @@ namespace NW4RTools { bTex.TexMapID = ins.ReadUInt32(); bTex.TlutID = ins.ReadUInt32(); - bTex.WrapS = ins.ReadUInt32(); - bTex.WrapT = ins.ReadUInt32(); + bTex.WrapS = (TextureWrapType)ins.ReadUInt32(); + bTex.WrapT = (TextureWrapType)ins.ReadUInt32(); bTex.MinFilt = ins.ReadUInt32(); bTex.MagFilt = ins.ReadUInt32(); bTex.LODBias = ins.ReadFloat(); -- cgit v1.2.3