Changeset 247 for trunk/UMapType.pas
- Timestamp:
- Sep 22, 2018, 1:27:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMapType.pas
r242 r247 25 25 procedure GetCellPosNeighbors(CellPos: TPoint; Cell: TCell); 26 26 function GetHexagonPolygon(Pos: TPoint; Size: TPoint): TPolygon; 27 protected 28 procedure SetSize(AValue: TPoint); override; 27 29 public 28 30 function CalculatePixelRect: TRect; override; … … 53 55 CellMulY = 1.05; 54 56 function GetTrianglePolygon(Pos: TPoint; Size: TPoint; Reverse: Boolean): TPolygon; 57 protected 58 procedure SetSize(AValue: TPoint); override; 55 59 public 56 60 procedure Generate; override; … … 75 79 CellMulY = 3.35; 76 80 function GetTilePolygon(Pos: TPoint; Size: TPoint): TPolygon; 81 protected 82 procedure SetSize(AValue: TPoint); override; 77 83 public 78 84 procedure Generate; override; … … 92 98 Result.Points[2] := TPoint.Create(Pos.X, Trunc(Pos.Y + Size.Y / 3.5)); 93 99 Result.Points[3] := TPoint.Create(Trunc(Pos.X - Size.X / 2), Pos.Y); 100 end; 101 102 procedure TIsometricMap.SetSize(AValue: TPoint); 103 begin 104 inherited; 105 if Cyclic then 106 FSize := TPoint.Create(FSize.X, FSize.Y + FSize.Y mod 2); 94 107 end; 95 108 … … 181 194 Result.Points[4] := TPoint.Create(Trunc(Pos.X - Shift.X * Size.X), Trunc(Pos.Y + Shift.Y * Size.Y)); 182 195 Result.Points[5] := TPoint.Create(Trunc(Pos.X - Shift.X * Size.X), Trunc(Pos.Y - Shift.Y * Size.Y)); 196 end; 197 198 procedure THexMap.SetSize(AValue: TPoint); 199 begin 200 inherited; 201 if Cyclic then 202 FSize := TPoint.Create(FSize.X, FSize.Y + FSize.Y mod 2); 183 203 end; 184 204 … … 478 498 end; 479 499 500 procedure TTriangleMap.SetSize(AValue: TPoint); 501 begin 502 inherited; 503 if Cyclic then 504 FSize := TPoint.Create(FSize.X + FSize.X mod 2, FSize.Y + FSize.Y mod 2); 505 end; 506 480 507 procedure TTriangleMap.Generate; 481 508 var
Note:
See TracChangeset
for help on using the changeset viewer.