diff options
Diffstat (limited to 'NW4RTools/ColladaExporter.cs')
-rw-r--r-- | NW4RTools/ColladaExporter.cs | 22 |
1 files changed, 21 insertions, 1 deletions
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<string> triStrips = new List<string>(); List<string> lineStrips = new List<string>(); + 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(); |