Pathfinder parallel change (#18736)

This commit is contained in:
metalgearsloth
2023-08-06 14:41:57 +10:00
committed by GitHub
parent 1d0160d158
commit cc5d83fe21
3 changed files with 11 additions and 11 deletions

View File

@@ -84,7 +84,7 @@ public sealed partial class PathfindingSystem
component.Chunks.Clear();
}
private void UpdateGrid()
private void UpdateGrid(ParallelOptions options)
{
if (PauseUpdating)
return;
@@ -94,10 +94,6 @@ public sealed partial class PathfindingSystem
var updateCount = 0;
#endif
_stopwatch.Restart();
var options = new ParallelOptions()
{
MaxDegreeOfParallelism = 1,
};
// We defer chunk updates because rebuilding a navmesh is hella costly
// Still run even when paused.
@@ -157,10 +153,9 @@ public sealed partial class PathfindingSystem
var doorQuery = GetEntityQuery<DoorComponent>();
var climbableQuery = GetEntityQuery<ClimbableComponent>();
var fixturesQuery = GetEntityQuery<FixturesComponent>();
var physicsQuery = GetEntityQuery<PhysicsComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
BuildBreadcrumbs(dirt[i], mapGridComp, accessQuery, destructibleQuery, doorQuery, climbableQuery,
fixturesQuery, physicsQuery, xformQuery);
fixturesQuery, xformQuery);
});
const int Division = 4;
@@ -427,7 +422,6 @@ public sealed partial class PathfindingSystem
EntityQuery<DoorComponent> doorQuery,
EntityQuery<ClimbableComponent> climbableQuery,
EntityQuery<FixturesComponent> fixturesQuery,
EntityQuery<PhysicsComponent> physicsQuery,
EntityQuery<TransformComponent> xformQuery)
{
var sw = new Stopwatch();