--- a/hedgewars/uLandPainted.pas Mon May 28 22:42:59 2012 +0400
+++ b/hedgewars/uLandPainted.pas Wed May 30 18:00:29 2012 +0400
@@ -43,78 +43,6 @@
var pointsListHead, pointsListLast: PPointEntry;
-procedure DrawLineOnLand(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
-var eX, eY, dX, dY: LongInt;
- i, sX, sY, x, y, d: LongInt;
- b: boolean;
- len: LongWord;
-begin
- len:= 0;
- if (X1 = X2) and (Y1 = Y2) then
- begin
- exit
- end;
- eX:= 0;
- eY:= 0;
- dX:= X2 - X1;
- dY:= Y2 - Y1;
-
- if (dX > 0) then
- sX:= 1
- else
- if (dX < 0) then
- begin
- sX:= -1;
- dX:= -dX
- end
- else
- sX:= dX;
-
- if (dY > 0) then
- sY:= 1
- else
- if (dY < 0) then
- begin
- sY:= -1;
- dY:= -dY
- end
- else
- sY:= dY;
-
- if (dX > dY) then
- d:= dX
- else
- d:= dY;
-
- x:= X1;
- y:= Y1;
-
- for i:= 0 to d do
- begin
- inc(eX, dX);
- inc(eY, dY);
- b:= false;
- if (eX > d) then
- begin
- dec(eX, d);
- inc(x, sX);
- b:= true
- end;
- if (eY > d) then
- begin
- dec(eY, d);
- inc(y, sY);
- b:= true
- end;
- if b then
- begin
- inc(len);
- if (len mod 4) = 0 then
- FillRoundInLand(X, Y, radius, color)
- end
- end
-end;
-
procedure chDraw(var s: shortstring);
var rec: PointRec;
prec: ^PointRec;
@@ -173,7 +101,8 @@
else
begin
AddFileLog('[DRAW] Line to: ('+inttostr(pe^.point.X)+','+inttostr(pe^.point.Y)+'), radius = '+inttostr(radius));
- DrawLineOnLand(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color);
+ DrawThickLine(prevPoint.X, prevPoint.Y, pe^.point.X, pe^.point.Y, radius, color);
+ FillRoundInLand(pe^.point.X, pe^.point.Y, radius, color)
end;
prevPoint:= pe^.point;