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
+16 -16
View File
@@ -18,8 +18,8 @@ namespace CodeWalker.GameFiles
public YndLink[] Links { get; set; }
public YndJunction[] Junctions { get; set; }
public VertexTypePC[] LinkedVerts { get; set; }//populated by the space (needs to use grid of all ynd's!)
public VertexTypePC[] TriangleVerts { get; set; } //used for junctions display
public EditorVertex[] LinkedVerts { get; set; }//populated by the space (needs to use grid of all ynd's!)
public EditorVertex[] TriangleVerts { get; set; } //used for junctions display
public Vector4[] NodePositions { get; set; }
public Vector3 BBMin { get; set; }
@@ -443,11 +443,11 @@ namespace CodeWalker.GameFiles
vc = Links.Length * 6;
}
List<VertexTypePC> verts = new List<VertexTypePC>(vc);
VertexTypePC v0 = new VertexTypePC();
VertexTypePC v1 = new VertexTypePC();
VertexTypePC v2 = new VertexTypePC();
VertexTypePC v3 = new VertexTypePC();
List<EditorVertex> verts = new List<EditorVertex>(vc);
EditorVertex v0 = new EditorVertex();
EditorVertex v1 = new EditorVertex();
EditorVertex v2 = new EditorVertex();
EditorVertex v3 = new EditorVertex();
if ((Links != null) && (Nodes != null))
{
foreach (var node in Nodes)
@@ -530,11 +530,11 @@ namespace CodeWalker.GameFiles
}
}
List<VertexTypePC> verts = new List<VertexTypePC>(vc);
VertexTypePC v0 = new VertexTypePC();
VertexTypePC v1 = new VertexTypePC();
VertexTypePC v2 = new VertexTypePC();
VertexTypePC v3 = new VertexTypePC();
List<EditorVertex> verts = new List<EditorVertex>(vc);
EditorVertex v0 = new EditorVertex();
EditorVertex v1 = new EditorVertex();
EditorVertex v2 = new EditorVertex();
EditorVertex v3 = new EditorVertex();
if (Nodes != null)
{
foreach (var node in Nodes)
@@ -638,11 +638,11 @@ namespace CodeWalker.GameFiles
public VertexTypePC[] GetPathVertices()
public EditorVertex[] GetPathVertices()
{
return LinkedVerts;
}
public VertexTypePC[] GetTriangleVertices()
public EditorVertex[] GetTriangleVertices()
{
return TriangleVerts;
}
@@ -1347,8 +1347,8 @@ namespace CodeWalker.GameFiles
{
//reuse this interface for file types that need to get paths rendered...
VertexTypePC[] GetPathVertices();
VertexTypePC[] GetTriangleVertices();
EditorVertex[] GetPathVertices();
EditorVertex[] GetTriangleVertices();
Vector4[] GetNodePositions();
}
+7 -7
View File
@@ -17,7 +17,7 @@ namespace CodeWalker.GameFiles
public List<YnvPoly> Polys { get; set; }
public VertexTypePC[] TriangleVerts { get; set; }
public EditorVertex[] TriangleVerts { get; set; }
public Vector4[] NodePositions { get; set; }
@@ -195,7 +195,7 @@ namespace CodeWalker.GameFiles
int vc = Vertices.Count;
List<VertexTypePC> rverts = new List<VertexTypePC>();
List<EditorVertex> rverts = new List<EditorVertex>();
foreach (var ypoly in Polys)
{
var poly = ypoly.RawData;
@@ -218,9 +218,9 @@ namespace CodeWalker.GameFiles
{ }
VertexTypePC p0 = new VertexTypePC();
VertexTypePC p1 = new VertexTypePC();
VertexTypePC p2 = new VertexTypePC();
EditorVertex p0 = new EditorVertex();
EditorVertex p1 = new EditorVertex();
EditorVertex p2 = new EditorVertex();
p0.Colour = colourval;
p1.Colour = colourval;
p2.Colour = colourval;
@@ -257,11 +257,11 @@ namespace CodeWalker.GameFiles
public VertexTypePC[] GetPathVertices()
public EditorVertex[] GetPathVertices()
{
return null;
}
public VertexTypePC[] GetTriangleVertices()
public EditorVertex[] GetTriangleVertices()
{
return TriangleVerts;
}
+62
View File
@@ -0,0 +1,62 @@
using SharpDX;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeWalker.GameFiles
{
public enum VertexType : uint
{
Default = 89, //PNCT
DefaultEx = 16473, //PNCTX
PNCCT = 121,
PNCCTTTT = 1017,
PCCNCCTTX = 16639,
PCCNCCT = 127,
PNCTTTX = 16857,
PNCTTX = 16601,
PNCTTTX_2 = 19545,
PNCTTTX_3 = 17113,
PNCCTTX = 16633,
PNCCTTX_2 = 17017,
PNCCTTTX = 17145,
PCCNCCTX = 16511,
PCCNCTX = 16479,
PCCNCT = 95,
PNCCTT = 249,
PNCCTX = 16505,
PCT = 81,
PT = 65,
PTT = 193,
PNC = 25,
PC = 17,
PCC = 7,
PCCH2H4 = 2147500121, //0x80004059 (16473 + 0x80000000) DefaultEx Cloth?
PNCH2 = 2147483737, //0x80000059 (89 + 0x80000000) Default Cloth?
PNCTTTTX = 19673, //normal_spec_detail_dpm_vertdecal_tnt
PNCTTTT = 985,
PCCNCCTT = 255,
PCTT = 209,
PCCCCT = 119,
PCCNC = 31,
PCCNCTT = 223,
PCCNCTTX = 16607,
PCCNCTTT = 479,
PNCTT = 217,
PNCTTT = 473,
}
//vertex data to be used by the editor. TODO: maybe move somewhere else.
public struct EditorVertex
{
public Vector3 Position;
public uint Colour;
}
}
File diff suppressed because it is too large Load Diff