2 Commits

2 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,5 @@
using Cryville.EEW.Core.Map;
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Http;
using System.Threading;
@@ -67,7 +66,6 @@ namespace Cryville.EEW.Unity.Map {
_downloadDone = true;
}
[SuppressMessage("CodeQuality", "IDE0051", Justification = "Unity message")]
void Update() {
if (_downloadDone) {
try {
@@ -100,7 +98,6 @@ namespace Cryville.EEW.Unity.Map {
_callback?.Invoke(this);
}
[SuppressMessage("CodeQuality", "IDE0051", Justification = "Unity message")]
void OnDestroy() {
if (_req != null) {
_req.Abort();

View File

@@ -77,7 +77,13 @@ namespace Cryville.EEW.Unity.Map {
DTSweep.Triangulate(tcx);
var codeToIndex = new Dictionary<uint, int>();
var vertices = ArrayPool<Vector3>.Shared.Rent(convertedPolygon.Points.Count);
int vertexCount = convertedPolygon.Points.Count;
if (convertedPolygon.Holes != null) {
foreach (var hole in convertedPolygon.Holes) {
vertexCount += hole.Points.Count;
}
}
var vertices = ArrayPool<Vector3>.Shared.Rent(vertexCount);
var triangles = ArrayPool<int>.Shared.Rent(convertedPolygon.Triangles.Count * 3);
int vi = 0, ii = 0;
foreach (var tri in convertedPolygon.Triangles) {