From 00e977b3dbb8f447b034b7be387ee1a1cce0598c Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 25 Feb 2011 22:08:57 +0100 Subject: start of a brres writer --- NW4RTools/BrresReader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'NW4RTools/BrresReader.cs') diff --git a/NW4RTools/BrresReader.cs b/NW4RTools/BrresReader.cs index 8b48ef3..518096d 100644 --- a/NW4RTools/BrresReader.cs +++ b/NW4RTools/BrresReader.cs @@ -44,7 +44,7 @@ namespace NW4RTools { UInt32 blkSize = ins.ReadUInt32(); using (var c = Debug.Push("Root Dictionary")) { - ReadAndParseDict(ins, ParseRootEntry); + ReadAndParseDict(ins, ParseRootEntry, "Root Dictionary"); } @@ -248,8 +248,13 @@ namespace NW4RTools { using (var c2 = Debug.Push("Shapes")) mdl.Shapes = ReadAndConvertDict(ins.At(startPos + shapeOffset), ConvertModelShape); - using (var c2 = Debug.Push("Texture Lookup for Texture Info/Material Pairing")) - mdl.PairingLookupByTexture = ReadAndConvertDict>(ins.At(startPos + textureOffset), ConvertPairingList); + if (textureOffset != 0) { + using (var c2 = Debug.Push("Texture Lookup for Texture Info/Material Pairing")) + mdl.PairingLookupByTexture = ReadAndConvertDict>(ins.At(startPos + textureOffset), ConvertPairingList); + } else { + mdl.PairingLookupByTexture = new ResDict>(); + Debug.Send("Texture Lookup for Texture Info/Material Pairing: none"); + } if (paletteOffset != 0) { using (var c2 = Debug.Push("Palette Lookup for Texture Info/Material Pairing")) -- cgit v1.2.3