Changeset 166 for trunk/UMap.pas


Ignore:
Timestamp:
Nov 23, 2017, 12:14:15 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Voronoi map option enabled for normal user. Map generation is still not perfect but playable.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UMap.pas

    r165 r166  
    298298  LeftText: string;
    299299  RightText: string;
     300  NeighborCell: TCell;
    300301begin
    301302  Clear;
     
    374375      LeftCell := Cell.Neighbors[I];
    375376      RightCell := Cell.Neighbors[(I + 1) mod Cell.Neighbors.Count];
    376       LeftText := LeftCell.Neighbors.ToString;
    377       RightText := RightCell.Neighbors.ToString;
     377      //LeftText := LeftCell.Neighbors.ToString;
     378      //RightText := RightCell.Neighbors.ToString;
    378379      LeftIndex := LeftCell.Neighbors.IndexOf(Cell);
    379380      RightIndex := RightCell.Neighbors.IndexOf(Cell);
     
    424425      Polygon := TPolygon.Create(Rect(0, 0,
    425426        Size.X * DefaultCellSize.X, Size.Y * DefaultCellSize.Y));
    426       for I := 0 to Cell.Neighbors.Count - 1 do begin
    427         LinkLine := TLine.Create(Cell.PosPx,
    428           Cell.Neighbors[I].PosPx);
     427      for NeighborCell in Cell.Neighbors do begin
     428        LinkLine := TLine.Create(Cell.PosPx, NeighborCell.PosPx);
    429429        LinkLine.Distance := LinkLine.Distance - 4;
    430430        MP := LinkLine.GetMiddle;
Note: See TracChangeset for help on using the changeset viewer.