This commit is contained in:
GoaLitiuM
2021-08-31 20:03:30 +03:00
parent f0faac7322
commit 1d2fc767e3
4 changed files with 2 additions and 1417 deletions

View File

@@ -19,7 +19,6 @@ namespace GoakeTests.MapParser
[SetUp]
public void Setup()
{
dm4Bytes = File.ReadAllBytes(@"C:\dev\GoakeFlax\Assets\Maps\dm4.map");
aerowalkBytes = File.ReadAllBytes(@"C:\dev\Goake\maps\aerowalk\aerowalk.map");
@@ -99,33 +98,6 @@ namespace GoakeTests.MapParser
// warmup?
//var roott = Game.MapParser.Parse(aerowalkBytes);
List<Game.MapEntity> mapEntities = new List<Game.MapEntity>(100);
aerowalkRoot = Game.MapParser.Parse(aerowalkBytes);
Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < 1; i++)
{
foreach (var ent in aerowalkRoot.entities)
foreach (var brush in ent.brushes)
{
Q3MapImporter.TriangulateBrush3(brush, out Vector3[] verts);
Assert.IsTrue(verts.Length > 0);
}
}
sw.Stop();
var elapsedMs = sw.Elapsed.TotalMilliseconds;
TestContext.Out.WriteLine("Triangulation time: " + elapsedMs + "ms");
}
[Test]
public void Perf_TriangulateAerowalk2()
{
// warmup?
//var roott = Game.MapParser.Parse(aerowalkBytes);
List<Game.MapEntity> mapEntities = new List<Game.MapEntity>(100);
aerowalkRoot = Game.MapParser.Parse(aerowalkBytes);
/*for (int i = 0; i < 1; i++)
@@ -172,7 +144,7 @@ namespace GoakeTests.MapParser
foreach (var ent in root.entities)
foreach (var brush in ent.brushes)
{
Q3MapImporter.TriangulateBrush3(brush, out Vector3[] verts);
Q3MapImporter.TriangulateBrush(brush, out Vector3[] verts);
Assert.IsTrue(verts.Length > 0);
}
}