diff options
author | Treeki <treeki@gmail.com> | 2011-05-24 01:05:54 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-05-24 01:05:54 +0200 |
commit | 1d64fe4efc123b8baec2b1dbbd5d87931ac626d2 (patch) | |
tree | c0e8848d09f56d3041a794594af0b79a5b174bd5 | |
parent | b726fbe95fa850f1e51dbc6a4a76f701dbb1db6b (diff) | |
download | nw4rtools-1d64fe4efc123b8baec2b1dbbd5d87931ac626d2.tar.gz nw4rtools-1d64fe4efc123b8baec2b1dbbd5d87931ac626d2.zip |
a few improvements to brres writing
Diffstat (limited to '')
-rw-r--r-- | NW4RTools/BrresWriter.cs | 13 |
1 files changed, 13 insertions, 0 deletions
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); |