diff options
Diffstat (limited to '')
-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(); |