@@ -361,7 +361,7 @@ begin
361361 end;
362362end;
363363
364- function TWebGraphGenerator.ConnectLastDoors(out graph: TWebGraph; idx, door: Integer; constref tree: TKDPointTree): TGraphNodeArray ;
364+ procedure TWebGraphGenerator.ConnectLastDoors(out graph: TWebGraph; idx, door: Integer; constref tree: TKDPointTree);
365365var
366366 p, q: TPoint;
367367 i, j: Integer;
@@ -510,36 +510,35 @@ var
510510 i, j: Integer;
511511 t: UInt64;
512512begin
513- white := map.FindColor($FFFFFF, 0);
514- red := map.FindColor($0000FF, 0);
515-
516- WriteLn GetDebugLn('Generating webgraph for region: ' + name);
517-
513+ WriteLn GetDebugLn('Generating webgraph for region: ' + name + ' this can take a few seconds.');
518514 t := GetTimeRunning();
519- Result := Self._BuildGraph(map, white, red);
520515
516+ white := map.FindColor($FFFFFF, 0);
517+ red := map.FindColor($0000FF, 0);
521518 gray := map.FindColor($333333, 0);
522519
520+ Result := Self._BuildGraph(map, white, red);
523521 grayClusters := gray.Cluster(1);
524522
525523 for i := 0 to High(Self.WhiteClusters) do
526524 begin
527- if Length(Self.WhiteClusters[i]) <= 6 then Continue;
525+ if Length(Self.WhiteClusters[i]) <= 6 then
526+ Continue;
528527
529528 graySubset := gray.ExtractBox(Self.WhiteClusters[i].Bounds().Expand(80));
530529 merged := Self.WhiteClusters[i] + graySubset;
531530 mergedClusters := merged.Cluster(1);
532531
533- for j := 0 to high (mergedClusters) do
532+ for j := 0 to High (mergedClusters) do
534533 if mergedClusters[j].Contains(Self.WhiteClusters[i][0]) then
535534 begin
536535 Result.WalkableClusters += mergedClusters[j];
537536 Break;
538537 end;
539538 end;
540539
541- Result.WalkableSpace := white + gray;
542- Result.ObjectClusters := grayClusters;
540+ Result.WalkableSpace := white + gray;
541+ Result.ObjectClusters := grayClusters;
543542
544543 Self.WhiteClusters := [];
545544 WriteLn GetDebugLn('WebGraphGenerator', 'Generating webgraph took ' + ToStr(Round(((GetTimeRunning()-t)/1000), 2)) + ' seconds.', ELogLevel.SUCCESS);
0 commit comments