From a7b952e51e8af35d903ae0a4fbe041423d35ff6d Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 6 Feb 2011 03:27:04 +0100 Subject: material reading support pretty much complete for now, just need to add shader offset fixups once I get shader support in --- NW4RTools/BrresReader.cs | 12 ++++++++++-- NW4RTools/Models/Material.cs | 6 +++++- NW4RTools/NW4RTools.pidb | Bin 71720 -> 73876 bytes NW4RTools/bin/Debug/NW4RTools.dll | Bin 28672 -> 28672 bytes NW4RTools/bin/Debug/NW4RTools.dll.mdb | Bin 10083 -> 10087 bytes 5 files changed, 15 insertions(+), 3 deletions(-) (limited to 'NW4RTools') diff --git a/NW4RTools/BrresReader.cs b/NW4RTools/BrresReader.cs index 70463d6..36634d0 100644 --- a/NW4RTools/BrresReader.cs +++ b/NW4RTools/BrresReader.cs @@ -426,9 +426,8 @@ namespace NW4RTools { Int32 unkOffset = ins.ReadInt32(); Debug.Send("Unknown offset for {0}: {1:X} [dest {2:X}]", name, unkOffset, startPos + unkOffset); - // Need to implement DLs... Int32 dlOffset = ins.ReadInt32(); - Debug.Send("DL offset for {0}: {1:X} [dest {2:X}]", name, dlOffset, startPos + dlOffset); + //Debug.Send("DL offset for {0}: {1:X} [dest {2:X}]", name, dlOffset, startPos + dlOffset); // ResTexObj int ResTexObjPos = ins.Position; @@ -543,6 +542,15 @@ namespace NW4RTools { ins.Skip(2); } + // Display Lists + OffsetMap.Add(startPos + dlOffset, "Material Display Lists: " + name); + + ins.Seek(startPos + dlOffset); + m.PixDL = ins.ReadBytes(0x20); + m.TevColorDL = ins.ReadBytes(0x80); + m.IndMtxAndScaleDL = ins.ReadBytes(0x40); + m.TexCoordGenDL = ins.ReadBytes(0xA0); + return m; } diff --git a/NW4RTools/Models/Material.cs b/NW4RTools/Models/Material.cs index 4540b0d..8ece6ad 100644 --- a/NW4RTools/Models/Material.cs +++ b/NW4RTools/Models/Material.cs @@ -56,7 +56,11 @@ namespace NW4RTools.Models { // Other public List BoundTextures; - // UNFINISHED + // Display Lists + public byte[] PixDL; + public byte[] TevColorDL; + public byte[] IndMtxAndScaleDL; + public byte[] TexCoordGenDL; public Material() { } diff --git a/NW4RTools/NW4RTools.pidb b/NW4RTools/NW4RTools.pidb index 726779f..5769072 100644 Binary files a/NW4RTools/NW4RTools.pidb and b/NW4RTools/NW4RTools.pidb differ diff --git a/NW4RTools/bin/Debug/NW4RTools.dll b/NW4RTools/bin/Debug/NW4RTools.dll index 1d9a2ad..fcfb2a6 100755 Binary files a/NW4RTools/bin/Debug/NW4RTools.dll and b/NW4RTools/bin/Debug/NW4RTools.dll differ diff --git a/NW4RTools/bin/Debug/NW4RTools.dll.mdb b/NW4RTools/bin/Debug/NW4RTools.dll.mdb index e3698a2..7d4ac90 100644 Binary files a/NW4RTools/bin/Debug/NW4RTools.dll.mdb and b/NW4RTools/bin/Debug/NW4RTools.dll.mdb differ -- cgit v1.2.3