@@ -17,6 +17,9 @@ Credits: Torwent
1717 {$I SRLT/osrs.simba}
1818{$ENDIF}
1919
20+ {.$DEFINE SRLT_GENERATE_GRAPH_ALWAYS}
21+
22+
2023type
2124(*
2225## TMapLoader Enums
@@ -393,7 +396,10 @@ function TRSMapLoader.GetGraph(name: String; plane: Integer; map: TImage): TWebG
393396var
394397 path: String;
395398begin
396- path := Self.CacheDir + 'graphs' + PATH_SEP + ToStr(plane) + PATH_SEP + name + '-' + GENERATED_GRAPH.Hash() + PATH_SEP;
399+ {$IFDEF SRLT_GENERATE_GRAPH_ALWAYS}
400+ Exit(WebGraphGenerator.BuildGraph(name, map));
401+ {$ENDIF}
402+ path := Self.CacheDir + 'graphs' + PATH_SEP + ToStr(plane) + PATH_SEP + name + '-' + WebGraphGenerator.Hash() + PATH_SEP;
397403
398404 if
399405 not FileExists(path + 'nodes.txt') or
@@ -407,7 +413,7 @@ begin
407413 if not DirCreate(path) then
408414 raise GetDebugLn('MapLoader', 'Failed to create cache directory: ' + path);
409415
410- Result := TWebGraph .BuildGraph(name, map);
416+ Result := WebGraphGenerator .BuildGraph(name, map);
411417
412418 if (Result.Nodes <> []) then
413419 if not FileWriteBytes(path + 'nodes.txt', CompressBytes(Result.Nodes.ToBytes())) then
@@ -574,7 +580,7 @@ begin
574580
575581 collisionmaps += Self.GetMap(s, f, chunks[i].Planes[j], ERSMap.COLLISION);
576582
577- if not GENERATED_GRAPH .Disabled then
583+ if not WebGraphGenerator .Disabled then
578584 graphs += Self.SetupGraph(name, idx, chunks[i].Planes[j], padding, collisionmaps[idx]);
579585
580586 collisionmaps[idx].Pad(padding);
@@ -603,7 +609,7 @@ begin
603609 Self.Heightmap := Self._InternalLoad(heightmaps);
604610 Self.Collision := Self._InternalLoad(collisionmaps);
605611
606- if not GENERATED_GRAPH .Disabled then
612+ if not WebGraphGenerator .Disabled then
607613 Self.Graph := Self.InternalGraphLoad(graphs);
608614
609615 (* TODO
0 commit comments