diff options
author | Treeki <treeki@gmail.com> | 2011-02-18 03:28:31 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-02-18 03:28:31 +0100 |
commit | b0760b28807b31cc1403584265c07feb87ac4887 (patch) | |
tree | dc97346a0c0d0cdcdc066d77df3905a614a858e8 /NW4RTools/BrresReader.cs | |
parent | 7d7491feb41bc9724bf63bef545b996226406889 (diff) | |
download | nw4rtools-b0760b28807b31cc1403584265c07feb87ac4887.tar.gz nw4rtools-b0760b28807b31cc1403584265c07feb87ac4887.zip |
some collada work, and an unfinished OGL renderer using OpenTK. huge commit
Diffstat (limited to 'NW4RTools/BrresReader.cs')
-rw-r--r-- | NW4RTools/BrresReader.cs | 19 |
1 files changed, 14 insertions, 5 deletions
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(); |