80 |
80 |
81 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
81 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
82 var i: LongInt; |
82 var i: LongInt; |
83 begin |
83 begin |
84 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
84 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
85 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
85 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
86 if (Land[y + dy, i] and lfIndestructible) = 0 then |
86 if (Land[y + dy, i] and lfIndestructible) = 0 then |
87 Land[y + dy, i]:= Value; |
87 Land[y + dy, i]:= Value; |
88 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
88 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
89 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
89 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
90 if (Land[y - dy, i] and lfIndestructible) = 0 then |
90 if (Land[y - dy, i] and lfIndestructible) = 0 then |
91 Land[y - dy, i]:= Value; |
91 Land[y - dy, i]:= Value; |
92 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
92 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
93 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
93 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
94 if (Land[y + dx, i] and lfIndestructible) = 0 then |
94 if (Land[y + dx, i] and lfIndestructible) = 0 then |
95 Land[y + dx, i]:= Value; |
95 Land[y + dx, i]:= Value; |
96 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
96 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
97 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
97 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
98 if (Land[y - dx, i] and lfIndestructible) = 0 then |
98 if (Land[y - dx, i] and lfIndestructible) = 0 then |
99 Land[y - dx, i]:= Value; |
99 Land[y - dx, i]:= Value; |
100 end; |
100 end; |
101 |
101 |
102 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean); |
102 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet, isCurrent: boolean); |
103 var i: LongInt; |
103 var i: LongInt; |
104 begin |
104 begin |
105 if not doSet then |
105 if not doSet then |
106 begin |
106 begin |
107 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
107 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
108 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
108 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
109 if isCurrent then |
109 if isCurrent then |
110 Land[y + dy, i]:= Land[y + dy, i] and $FF7F |
110 Land[y + dy, i]:= Land[y + dy, i] and $FF7F |
111 else if Land[y + dy, i] and $007F > 0 then |
111 else if Land[y + dy, i] and $007F > 0 then |
112 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1); |
112 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) - 1); |
113 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
113 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
114 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
114 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
115 if isCurrent then |
115 if isCurrent then |
116 Land[y - dy, i]:= Land[y - dy, i] and $FF7F |
116 Land[y - dy, i]:= Land[y - dy, i] and $FF7F |
117 else if Land[y - dy, i] and $007F > 0 then |
117 else if Land[y - dy, i] and $007F > 0 then |
118 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1); |
118 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) - 1); |
119 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
119 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
120 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
120 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
121 if isCurrent then |
121 if isCurrent then |
122 Land[y + dx, i]:= Land[y + dx, i] and $FF7F |
122 Land[y + dx, i]:= Land[y + dx, i] and $FF7F |
123 else if Land[y + dx, i] and $007F > 0 then |
123 else if Land[y + dx, i] and $007F > 0 then |
124 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1); |
124 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) - 1); |
125 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
125 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
126 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
126 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
127 if isCurrent then |
127 if isCurrent then |
128 Land[y - dx, i]:= Land[y - dx, i] and $FF7F |
128 Land[y - dx, i]:= Land[y - dx, i] and $FF7F |
129 else if Land[y - dx, i] and $007F > 0 then |
129 else if Land[y - dx, i] and $007F > 0 then |
130 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1) |
130 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) - 1) |
131 end |
131 end |
132 else |
132 else |
133 begin |
133 begin |
134 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
134 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
135 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
135 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
136 if isCurrent then |
136 if isCurrent then |
137 Land[y + dy, i]:= Land[y + dy, i] or $80 |
137 Land[y + dy, i]:= Land[y + dy, i] or $80 |
138 else if Land[y + dy, i] and $007F < 127 then |
138 else if Land[y + dy, i] and $007F < 127 then |
139 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1); |
139 Land[y + dy, i]:= (Land[y + dy, i] and $FF80) or ((Land[y + dy, i] and $7F) + 1); |
140 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
140 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
141 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
141 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
142 if isCurrent then |
142 if isCurrent then |
143 Land[y - dy, i]:= Land[y - dy, i] or $80 |
143 Land[y - dy, i]:= Land[y - dy, i] or $80 |
144 else if Land[y - dy, i] and $007F < 127 then |
144 else if Land[y - dy, i] and $007F < 127 then |
145 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1); |
145 Land[y - dy, i]:= (Land[y - dy, i] and $FF80) or ((Land[y - dy, i] and $7F) + 1); |
146 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
146 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
147 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
147 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
148 if isCurrent then |
148 if isCurrent then |
149 Land[y + dx, i]:= Land[y + dx, i] or $80 |
149 Land[y + dx, i]:= Land[y + dx, i] or $80 |
150 else if Land[y + dx, i] and $007F < 127 then |
150 else if Land[y + dx, i] and $007F < 127 then |
151 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1); |
151 Land[y + dx, i]:= (Land[y + dx, i] and $FF80) or ((Land[y + dx, i] and $7F) + 1); |
152 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
152 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
153 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
153 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
154 if isCurrent then |
154 if isCurrent then |
155 Land[y - dx, i]:= Land[y - dx, i] or $80 |
155 Land[y - dx, i]:= Land[y - dx, i] or $80 |
156 else if Land[y - dx, i] and $007F < 127 then |
156 else if Land[y - dx, i] and $007F < 127 then |
157 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1) |
157 Land[y - dx, i]:= (Land[y - dx, i] and $FF80) or ((Land[y - dx, i] and $7F) + 1) |
158 end |
158 end |
205 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
205 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
206 var i, t: LongInt; |
206 var i, t: LongInt; |
207 begin |
207 begin |
208 t:= y + dy; |
208 t:= y + dy; |
209 if (t and LAND_HEIGHT_MASK) = 0 then |
209 if (t and LAND_HEIGHT_MASK) = 0 then |
210 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
210 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
211 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
211 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
212 if (cReducedQuality and rqBlurryLand) = 0 then |
212 if (cReducedQuality and rqBlurryLand) = 0 then |
213 LandPixels[t, i]:= 0 |
213 LandPixels[t, i]:= 0 |
214 else |
214 else |
215 LandPixels[t div 2, i div 2]:= 0; |
215 LandPixels[t div 2, i div 2]:= 0; |
216 |
216 |
217 t:= y - dy; |
217 t:= y - dy; |
218 if (t and LAND_HEIGHT_MASK) = 0 then |
218 if (t and LAND_HEIGHT_MASK) = 0 then |
219 for i:= Min(x + dx, LAND_WIDTH - 1) downto Max(x - dx, 0) do |
219 for i:= Max(x - dx, 0) to Min(x + dx, LAND_WIDTH - 1) do |
220 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
220 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
221 if (cReducedQuality and rqBlurryLand) = 0 then |
221 if (cReducedQuality and rqBlurryLand) = 0 then |
222 LandPixels[t, i]:= 0 |
222 LandPixels[t, i]:= 0 |
223 else |
223 else |
224 LandPixels[t div 2, i div 2]:= 0; |
224 LandPixels[t div 2, i div 2]:= 0; |
225 |
225 |
226 t:= y + dx; |
226 t:= y + dx; |
227 if (t and LAND_HEIGHT_MASK) = 0 then |
227 if (t and LAND_HEIGHT_MASK) = 0 then |
228 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
228 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
229 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
229 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
230 if (cReducedQuality and rqBlurryLand) = 0 then |
230 if (cReducedQuality and rqBlurryLand) = 0 then |
231 LandPixels[t, i]:= 0 |
231 LandPixels[t, i]:= 0 |
232 else |
232 else |
233 LandPixels[t div 2, i div 2]:= 0; |
233 LandPixels[t div 2, i div 2]:= 0; |
234 |
234 |
235 t:= y - dx; |
235 t:= y - dx; |
236 if (t and LAND_HEIGHT_MASK) = 0 then |
236 if (t and LAND_HEIGHT_MASK) = 0 then |
237 for i:= Min(x + dy, LAND_WIDTH - 1) downto Max(x - dy, 0) do |
237 for i:= Max(x - dy, 0) to Min(x + dy, LAND_WIDTH - 1) do |
238 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
238 if ((Land[t, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[t, i] > 255)) then |
239 if (cReducedQuality and rqBlurryLand) = 0 then |
239 if (cReducedQuality and rqBlurryLand) = 0 then |
240 LandPixels[t, i]:= 0 |
240 LandPixels[t, i]:= 0 |
241 else |
241 else |
242 LandPixels[t div 2, i div 2]:= 0; |
242 LandPixels[t div 2, i div 2]:= 0; |