equal
deleted
inserted
replaced
40 point: PointRec; |
40 point: PointRec; |
41 next: PPointEntry; |
41 next: PPointEntry; |
42 end; |
42 end; |
43 |
43 |
44 var pointsListHead, pointsListLast: PPointEntry; |
44 var pointsListHead, pointsListLast: PPointEntry; |
45 |
|
46 procedure DrawLineOnLand(X1, Y1, X2, Y2, radius: LongInt; color: Longword); |
|
47 var eX, eY, dX, dY: LongInt; |
|
48 i, sX, sY, x, y, d: LongInt; |
|
49 b: boolean; |
|
50 len: LongWord; |
|
51 begin |
|
52 len:= 0; |
|
53 if (X1 = X2) and (Y1 = Y2) then |
|
54 begin |
|
55 exit |
|
56 end; |
|
57 eX:= 0; |
|
58 eY:= 0; |
|
59 dX:= X2 - X1; |
|
60 dY:= Y2 - Y1; |
|
61 |
|
62 if (dX > 0) then |
|
63 sX:= 1 |
|
64 else |
|
65 if (dX < 0) then |
|
66 begin |
|
67 sX:= -1; |
|
68 dX:= -dX |
|
69 end |
|
70 else |
|
71 sX:= dX; |
|
72 |
|
73 if (dY > 0) then |
|
74 sY:= 1 |
|
75 else |
|
76 if (dY < 0) then |
|
77 begin |
|
78 sY:= -1; |
|
79 dY:= -dY |
|
80 end |
|
81 else |
|
82 sY:= dY; |
|
83 |
|
84 if (dX > dY) then |
|
85 d:= dX |
|
86 else |
|
87 d:= dY; |
|
88 |
|
89 x:= X1; |
|
90 y:= Y1; |
|
91 |
|
92 for i:= 0 to d do |
|
93 begin |
|
94 inc(eX, dX); |
|
95 inc(eY, dY); |
|
96 b:= false; |
|
97 if (eX > d) then |
|
98 begin |
|
99 dec(eX, d); |
|
100 inc(x, sX); |
|
101 b:= true |
|
102 end; |
|
103 if (eY > d) then |
|
104 begin |
|
105 dec(eY, d); |
|
106 inc(y, sY); |
|
107 b:= true |
|
108 end; |
|
109 if b then |
|
110 begin |
|
111 inc(len); |
|
112 if (len mod 4) = 0 then |
|
113 FillRoundInLand(X, Y, radius, color) |
|
114 end |
|
115 end |
|
116 end; |
|
117 |
45 |
118 procedure chDraw(var s: shortstring); |
46 procedure chDraw(var s: shortstring); |
119 var rec: PointRec; |
47 var rec: PointRec; |
120 prec: ^PointRec; |
48 prec: ^PointRec; |
121 pe: PPointEntry; |
49 pe: PPointEntry; |
171 FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color) |
99 FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color) |
172 end |
100 end |
173 else |
101 else |
174 begin |
102 begin |
175 AddFileLog('[DRAW] Line to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+'), radius = '+inttostr(radius)); |
103 AddFileLog('[DRAW] Line to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+'), radius = '+inttostr(radius)); |
176 DrawLineOnLand(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color); |
104 DrawThickLine(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color); |
|
105 FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color) |
177 end; |
106 end; |
178 |
107 |
179 prevPoint:= pe^.point; |
108 prevPoint:= pe^.point; |
180 pe:= pe^.next; |
109 pe:= pe^.next; |
181 end; |
110 end; |