summaryrefslogtreecommitdiff
path: root/NW4RTools/ColladaExporter.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-02-18 01:37:50 +0100
committerTreeki <treeki@gmail.com>2012-02-18 01:37:50 +0100
commit27042ea7b29185b89e972dd540905f8676ccf01e (patch)
tree5b7e8ae10d837460e5babbbc1e08a21dd5d7a1fd /NW4RTools/ColladaExporter.cs
parent3887d40e03f13ffc7941ef22bda6de13395fd285 (diff)
downloadnw4rtools-27042ea7b29185b89e972dd540905f8676ccf01e.tar.gz
nw4rtools-27042ea7b29185b89e972dd540905f8676ccf01e.zip
updates I made to Collada Exporter in November and never committed
Diffstat (limited to '')
-rw-r--r--NW4RTools/ColladaExporter.cs40
1 files changed, 29 insertions, 11 deletions
diff --git a/NW4RTools/ColladaExporter.cs b/NW4RTools/ColladaExporter.cs
index ccdc6b0..645b8dc 100644
--- a/NW4RTools/ColladaExporter.cs
+++ b/NW4RTools/ColladaExporter.cs
@@ -411,7 +411,7 @@ namespace NW4RTools {
ambientClr.Values = new double[] { 0, 0, 0, 1 };
pShader.ambient.Item = ambientClr;
- pShader.transparent = new common_transparent_type();
+ /*pShader.transparent = new common_transparent_type();
pShader.transparent.opaque = fx_opaque_enum.A_ONE;
var transparentClr = new common_color_or_texture_typeColor();
transparentClr.Values = new double[] { 1, 1, 1, 1 };
@@ -421,7 +421,7 @@ namespace NW4RTools {
bs.Value = 1;
pShader.transparency.Item = bs;
// we can reuse DiffuseTex!
- pShader.transparent.Item = diffuseTex;
+ pShader.transparent.Item = diffuseTex;*/
profile.technique.Item = pShader;
@@ -641,7 +641,8 @@ namespace NW4RTools {
// Create a list for tristrips beforehand, because they're THE most common
List<string> triStrips = new List<string>();
-
+ List<string> lineStrips = new List<string>();
+
// Now go through the display list
while (true) {
@@ -654,7 +655,8 @@ namespace NW4RTools {
PrimitiveType prim = (PrimitiveType)((cmd >> 3) & 7);
int vtxCount = dl.ReadUInt16();
-
+ Console.WriteLine("Got {0} , {1}", prim, vtxCount);
+
// first, parse it into a list of vertices
GXIndexedVertex[] vtxs = new GXIndexedVertex[vtxCount];
string[] pVtxs = new string[vtxCount];
@@ -688,7 +690,6 @@ namespace NW4RTools {
pTriData.AppendFormat("{0} ", pVtxs[i]);
}
-
pTri.p = pTriData.ToString();
meshItems.Add(pTri);
@@ -701,13 +702,21 @@ namespace NW4RTools {
pTriStripData.AppendFormat("{0} ", pVtxs[i]);
}
-
triStrips.Add(pTriStripData.ToString());
break;
+
+ case PrimitiveType.LineStrip:
+ StringBuilder pLineStripData = new StringBuilder();
+
+ for (int i = 0; i < vtxCount; i++) {
+ pLineStripData.AppendFormat("{0} ", pVtxs[i]);
+ }
+
+ lineStrips.Add(pLineStripData.ToString());
+ break;
+
default:
-
-
- Console.WriteLine("UNIMPLEMENTED PRIMITIVE TYPE");
+ Console.WriteLine("UNIMPLEMENTED PRIMITIVE TYPE : %s", prim);
return geo;
}
}
@@ -722,8 +731,17 @@ namespace NW4RTools {
pTriStrips.p = triStrips.ToArray();
meshItems.Add(pTriStrips);
}
-
-
+
+ if (lineStrips.Count > 0) {
+ var pLineStrips = new linestrips();
+ pLineStrips.material = "NW4R_MATERIAL";
+ pLineStrips.input = inputArray;
+ pLineStrips.count = (ulong)lineStrips.Count;
+ pLineStrips.p = lineStrips.ToArray();
+ meshItems.Add(pLineStrips);
+ }
+
+
m.Items = meshItems.ToArray();
// FINALLY DONE!