Moved DX-dependent vertex types stuff to Rendering namespace

This commit is contained in:
dexyfex
2017-12-14 22:45:43 +11:00
Unverified
parent 14e1ce6ffd
commit 96638b8317
11 changed files with 117 additions and 98 deletions
+8 -8
View File
@@ -19,16 +19,16 @@ namespace CodeWalker.World
{
return null;
}
public VertexTypePC[] GetPathVertices()
public EditorVertex[] GetPathVertices()
{
return null;
}
public VertexTypePC[] GetTriangleVertices()
public EditorVertex[] GetTriangleVertices()
{
return TriangleVerts;
}
public VertexTypePC[] TriangleVerts;
public EditorVertex[] TriangleVerts;
@@ -103,11 +103,11 @@ namespace CodeWalker.World
public void BuildVertices()
{
var vlist = new List<VertexTypePC>();
var v1 = new VertexTypePC();
var v2 = new VertexTypePC();
var v3 = new VertexTypePC();
var v4 = new VertexTypePC();
var vlist = new List<EditorVertex>();
var v1 = new EditorVertex();
var v2 = new EditorVertex();
var v3 = new EditorVertex();
var v4 = new EditorVertex();
foreach (var group in Groups.Values)
{
+7 -7
View File
@@ -118,15 +118,15 @@ namespace CodeWalker.World
[TypeConverter(typeof(ExpandableObjectConverter))] public class ScenarioRegion : BasePathData
{
public VertexTypePC[] PathVerts { get; set; }
public VertexTypePC[] TriangleVerts { get; set; }
public EditorVertex[] PathVerts { get; set; }
public EditorVertex[] TriangleVerts { get; set; }
public Vector4[] NodePositions { get; set; }
public VertexTypePC[] GetPathVertices()
public EditorVertex[] GetPathVertices()
{
return PathVerts;
}
public VertexTypePC[] GetTriangleVertices()
public EditorVertex[] GetTriangleVertices()
{
return TriangleVerts;
}
@@ -441,7 +441,7 @@ namespace CodeWalker.World
public void BuildVertices()
{
List<VertexTypePC> pathverts = new List<VertexTypePC>();
List<EditorVertex> pathverts = new List<EditorVertex>();
uint cred = (uint)Color.Red.ToRgba();
uint cblu = (uint)Color.Blue.ToRgba();
@@ -451,8 +451,8 @@ namespace CodeWalker.World
if ((Ymt != null) && (Ymt.CScenarioPointRegion != null))
{
var r = Ymt.CScenarioPointRegion;
VertexTypePC pv1 = new VertexTypePC();
VertexTypePC pv2 = new VertexTypePC();
EditorVertex pv1 = new EditorVertex();
EditorVertex pv2 = new EditorVertex();
if ((r.Paths != null) && (r.Paths.Nodes != null))
{
+6 -6
View File
@@ -522,7 +522,7 @@ namespace CodeWalker.World
//join the dots....
//StringBuilder sb = new StringBuilder();
List<VertexTypePC> tverts = new List<VertexTypePC>();
List<EditorVertex> tverts = new List<EditorVertex>();
List<YndLink> tlinks = new List<YndLink>();
List<YndLink> nlinks = new List<YndLink>();
foreach (var ynd in AllYnds.Values)
@@ -605,7 +605,7 @@ namespace CodeWalker.World
ynd.Links = tlinks.ToArray();
}
public void BuildYndVerts(YndFile ynd, List<VertexTypePC> tverts = null)
public void BuildYndVerts(YndFile ynd, List<EditorVertex> tverts = null)
{
var ynodes = ynd.Nodes;
if (ynodes == null) return;
@@ -613,7 +613,7 @@ namespace CodeWalker.World
int nodecount = ynodes.Length;
//build the main linked vertex array (used by the renderable to draw the lines).
if(tverts==null) tverts = new List<VertexTypePC>();
if(tverts==null) tverts = new List<EditorVertex>();
tverts.Clear();
for (int i = 0; i < nodecount; i++)
{
@@ -621,7 +621,7 @@ namespace CodeWalker.World
if (node.Links == null) continue;
var nvert = new VertexTypePC();
var nvert = new EditorVertex();
nvert.Position = node.Position;
nvert.Colour = (uint)node.Colour.ToRgba();
@@ -631,7 +631,7 @@ namespace CodeWalker.World
YndLink yl = node.Links[l];
var tnode = yl.Node2;
if (tnode == null) continue; //invalid links could hit here
var tvert = new VertexTypePC();
var tvert = new EditorVertex();
tvert.Position = tnode.Position;
tvert.Colour = (uint)tnode.Colour.ToRgba();
@@ -679,7 +679,7 @@ namespace CodeWalker.World
}
}
public void BuildYndData(YndFile ynd, List<VertexTypePC> tverts = null, List<YndLink> tlinks = null, List<YndLink> nlinks = null)
public void BuildYndData(YndFile ynd, List<EditorVertex> tverts = null, List<YndLink> tlinks = null, List<YndLink> nlinks = null)
{
BuildYndLinks(ynd, tlinks, nlinks);
+4 -4
View File
@@ -81,14 +81,14 @@ namespace CodeWalker.World
}
public VertexTypePC[] LinkedVerts { get; set; }
public EditorVertex[] LinkedVerts { get; set; }
public Vector4[] NodePositions { get; set; }
public VertexTypePC[] GetPathVertices()
public EditorVertex[] GetPathVertices()
{
return LinkedVerts;
}
public VertexTypePC[] GetTriangleVertices()
public EditorVertex[] GetTriangleVertices()
{
return null;
}
@@ -245,7 +245,7 @@ namespace CodeWalker.World
var lc = nc - 1;
var lvc = lc * 2;
var np = new Vector4[nc];
var lv = new VertexTypePC[lvc];
var lv = new EditorVertex[lvc];
for (int i = 0; i < nc; i++)
{
np[i] = new Vector4(Nodes[i].Position, 1.0f);