From c9bfbf84244c8aa4e26ece994ef6b93386c708e3 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 23 Sep 2012 17:43:33 +0200 Subject: tons of junk I'll clean up eventually --- NW4RTools/ColladaExporter.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'NW4RTools/ColladaExporter.cs') diff --git a/NW4RTools/ColladaExporter.cs b/NW4RTools/ColladaExporter.cs index 645b8dc..8ee111e 100644 --- a/NW4RTools/ColladaExporter.cs +++ b/NW4RTools/ColladaExporter.cs @@ -643,6 +643,7 @@ namespace NW4RTools { List triStrips = new List(); List lineStrips = new List(); + File.WriteAllBytes("DL.bin", shape.DisplayList2); // Now go through the display list while (true) { @@ -651,7 +652,26 @@ namespace NW4RTools { byte cmd = dl.ReadByte(); if (cmd == 0) - break; + continue; + + // These can contain other stuff. Who knew. + + if ((cmd & 0x80) == 0) { + GXCommand castCmd = (GXCommand)cmd; + + switch (castCmd) { + case GXCommand.LoadPosMtxFromArray: + case GXCommand.LoadNrmMtxFromArray: + case GXCommand.LoadTexCoordMtxFromArray: + case GXCommand.LoadLightFromArray: + dl.Skip(4); + break; + default: + Console.WriteLine("UNIMPLEMENTED GX COMMAND: {0}", castCmd); + break; + } + continue; // don't process it as a primitive + } PrimitiveType prim = (PrimitiveType)((cmd >> 3) & 7); int vtxCount = dl.ReadUInt16(); -- cgit v1.2.3