From 1d64fe4efc123b8baec2b1dbbd5d87931ac626d2 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 24 May 2011 01:05:54 +0200 Subject: a few improvements to brres writing --- NW4RTools/BrresWriter.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NW4RTools/BrresWriter.cs b/NW4RTools/BrresWriter.cs index cf48cdd..f0dc0a1 100644 --- a/NW4RTools/BrresWriter.cs +++ b/NW4RTools/BrresWriter.cs @@ -329,15 +329,19 @@ namespace NW4RTools { CurrentPos += 0x18; // ResTexObj + LogPosition("Material ResTexObj: " + kv.Key); CurrentPos += 0x104; // ResTlutObj + LogPosition("Material ResTlutObj: " + kv.Key); CurrentPos += 0x64; // ResTexSrt + LogPosition("Material ResTexSrt: " + kv.Key); CurrentPos += 8 + (0x14 * 8) + (0x34 * 8); // ResMatChan + LogPosition("Material ResMatChan: " + kv.Key); CurrentPos += 0x28; // Texture Infos @@ -1032,6 +1036,15 @@ namespace NW4RTools { // Display Lists Output.AlignTo(0x20); + if (mat.PixDL.Length != 0x20) + throw new Exception("Material " + kv.Key + " PixDL must be size 0x20"); + if (mat.TevColorDL.Length != 0x80) + throw new Exception("Material " + kv.Key + " TevColorDL must be size 0x20"); + if (mat.IndMtxAndScaleDL.Length != 0x40) + throw new Exception("Material " + kv.Key + " IndMtxAndScaleDL must be size 0x20"); + if (mat.TexCoordGenDL.Length != 0xA0) + throw new Exception("Material " + kv.Key + " TexCoordGenDL must be size 0x20"); + Output.WriteBytes(mat.PixDL); Output.WriteBytes(mat.TevColorDL); Output.WriteBytes(mat.IndMtxAndScaleDL); -- cgit v1.2.3