1055 if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then |
1055 if ((x and LAND_WIDTH_MASK) = 0) and ((y and LAND_HEIGHT_MASK) = 0) then |
1056 Land[y, x]:= Color; |
1056 Land[y, x]:= Color; |
1057 end |
1057 end |
1058 end; |
1058 end; |
1059 |
1059 |
1060 procedure DrawLines(X1, Y1, X2, Y2, dx, dy: LongInt; color: Longword); |
1060 procedure DrawDots(x, y, xx, yy: Longint; Color: Longword); inline; |
1061 begin |
1061 begin |
1062 DrawLine(x1 + dx, y1 + dy, x2 + dx, y2 + dy, color); |
1062 if (((x + xx) and LAND_WIDTH_MASK) = 0) and (((y + yy) and LAND_HEIGHT_MASK) = 0) then Land[y + yy, x + xx]:= Color; |
1063 DrawLine(x1 + dx, y1 - dy, x2 + dx, y2 - dy, color); |
1063 if (((x + xx) and LAND_WIDTH_MASK) = 0) and (((y - yy) and LAND_HEIGHT_MASK) = 0) then Land[y - yy, x + xx]:= Color; |
1064 DrawLine(x1 - dx, y1 + dy, x2 - dx, y2 + dy, color); |
1064 if (((x - xx) and LAND_WIDTH_MASK) = 0) and (((y + yy) and LAND_HEIGHT_MASK) = 0) then Land[y + yy, x - xx]:= Color; |
1065 DrawLine(x1 - dx, y1 - dy, x2 - dx, y2 - dy, color); |
1065 if (((x - xx) and LAND_WIDTH_MASK) = 0) and (((y - yy) and LAND_HEIGHT_MASK) = 0) then Land[y - yy, x - xx]:= Color; |
1066 |
1066 if (((x + yy) and LAND_WIDTH_MASK) = 0) and (((y + xx) and LAND_HEIGHT_MASK) = 0) then Land[y + xx, x + yy]:= Color; |
1067 DrawLine(x1 + dy, y1 + dx, x2 + dy, y2 + dx, color); |
1067 if (((x + yy) and LAND_WIDTH_MASK) = 0) and (((y - xx) and LAND_HEIGHT_MASK) = 0) then Land[y - xx, x + yy]:= Color; |
1068 DrawLine(x1 + dy, y1 - dx, x2 + dy, y2 - dx, color); |
1068 if (((x - yy) and LAND_WIDTH_MASK) = 0) and (((y + xx) and LAND_HEIGHT_MASK) = 0) then Land[y + xx, x - yy]:= Color; |
1069 DrawLine(x1 - dy, y1 + dx, x2 - dy, y2 + dx, color); |
1069 if (((x - yy) and LAND_WIDTH_MASK) = 0) and (((y - xx) and LAND_HEIGHT_MASK) = 0) then Land[y - xx, x - yy]:= Color; |
1070 DrawLine(x1 - dy, y1 - dx, x2 - dy, y2 - dx, color); |
1070 end; |
|
1071 |
|
1072 procedure DrawLines(X1, Y1, X2, Y2, XX, YY: LongInt; color: Longword); |
|
1073 var |
|
1074 eX, eY, dX, dY: LongInt; |
|
1075 i, sX, sY, x, y, d: LongInt; |
|
1076 f: boolean; |
|
1077 begin |
|
1078 eX:= 0; |
|
1079 eY:= 0; |
|
1080 dX:= X2 - X1; |
|
1081 dY:= Y2 - Y1; |
|
1082 |
|
1083 if (dX > 0) then |
|
1084 sX:= 1 |
|
1085 else |
|
1086 if (dX < 0) then |
|
1087 begin |
|
1088 sX:= -1; |
|
1089 dX:= -dX |
|
1090 end |
|
1091 else |
|
1092 sX:= dX; |
|
1093 |
|
1094 if (dY > 0) then |
|
1095 sY:= 1 |
|
1096 else |
|
1097 if (dY < 0) then |
|
1098 begin |
|
1099 sY:= -1; |
|
1100 dY:= -dY |
|
1101 end |
|
1102 else |
|
1103 sY:= dY; |
|
1104 |
|
1105 if (dX > dY) then |
|
1106 d:= dX |
|
1107 else |
|
1108 d:= dY; |
|
1109 |
|
1110 x:= X1; |
|
1111 y:= Y1; |
|
1112 |
|
1113 for i:= 0 to d do |
|
1114 begin |
|
1115 inc(eX, dX); |
|
1116 inc(eY, dY); |
|
1117 |
|
1118 f:= eX > d; |
|
1119 if f then |
|
1120 begin |
|
1121 dec(eX, d); |
|
1122 inc(x, sX); |
|
1123 DrawDots(x, y, xx, yy, color) |
|
1124 end; |
|
1125 if (eY > d) then |
|
1126 begin |
|
1127 dec(eY, d); |
|
1128 inc(y, sY); |
|
1129 f:= true; |
|
1130 DrawDots(x, y, xx, yy, color) |
|
1131 end; |
|
1132 |
|
1133 if not f then |
|
1134 DrawDots(x, y, xx, yy, color) |
|
1135 end |
1071 end; |
1136 end; |
1072 |
1137 |
1073 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword); |
1138 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword); |
1074 var dx, dy, d: LongInt; |
1139 var dx, dy, d: LongInt; |
1075 begin |
1140 begin |