139 end; |
139 end; |
140 if (dx = dy) then ChangeCircleLines(x, y, dx, dy, doSet) |
140 if (dx = dy) then ChangeCircleLines(x, y, dx, dy, doSet) |
141 end; |
141 end; |
142 |
142 |
143 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
143 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
144 var i: LongInt; |
144 var i, t: LongInt; |
145 begin |
145 begin |
146 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
146 t:= y + dy; |
|
147 if (t and LAND_HEIGHT_MASK) = 0 then |
147 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
148 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
148 if (not isMap and ((Land[y + dy, i] and lfIndestructible) = 0)) or ((Land[y + dy, i] and lfBasic) <> 0) then |
149 if (not isMap and ((Land[t, i] and lfIndestructible) = 0)) or ((Land[t, i] and lfBasic) <> 0) then |
149 if (cReducedQuality and rqBlurryLand) = 0 then |
150 if (cReducedQuality and rqBlurryLand) = 0 then |
150 LandPixels[y + dy, i]:= 0 |
151 LandPixels[t, i]:= 0 |
151 else |
152 else |
152 LandPixels[(y + dy) div 2, i div 2]:= 0; |
153 LandPixels[t div 2, i div 2]:= 0; |
153 |
154 |
154 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
155 t:= y - dy; |
|
156 if (t and LAND_HEIGHT_MASK) = 0 then |
155 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
157 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
156 if (not isMap and ((Land[y - dy, i] and lfIndestructible) = 0)) or ((Land[y - dy, i] and lfBasic) <> 0) then |
158 if (not isMap and ((Land[t, i] and lfIndestructible) = 0)) or ((Land[t, i] and lfBasic) <> 0) then |
157 if (cReducedQuality and rqBlurryLand) = 0 then |
159 if (cReducedQuality and rqBlurryLand) = 0 then |
158 LandPixels[y - dy, i]:= 0 |
160 LandPixels[t, i]:= 0 |
159 else |
161 else |
160 LandPixels[(y - dy) div 2, i div 2]:= 0; |
162 LandPixels[t div 2, i div 2]:= 0; |
161 |
163 |
162 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
164 t:= y + dx; |
|
165 if (t and LAND_HEIGHT_MASK) = 0 then |
163 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
166 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
164 if (not isMap and ((Land[y + dx, i] and lfIndestructible) = 0)) or ((Land[y + dx, i] and lfBasic) <> 0) then |
167 if (not isMap and ((Land[t, i] and lfIndestructible) = 0)) or ((Land[t, i] and lfBasic) <> 0) then |
165 if (cReducedQuality and rqBlurryLand) = 0 then |
168 if (cReducedQuality and rqBlurryLand) = 0 then |
166 LandPixels[y + dx, i]:= 0 |
169 LandPixels[t, i]:= 0 |
167 else |
170 else |
168 LandPixels[(y + dx) div 2, i div 2]:= 0; |
171 LandPixels[t div 2, i div 2]:= 0; |
169 |
172 |
170 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
173 t:= y - dx; |
|
174 if (t and LAND_HEIGHT_MASK) = 0 then |
171 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
175 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
172 if (not isMap and ((Land[y - dx, i] and lfIndestructible) = 0)) or ((Land[y - dx, i] and lfBasic) <> 0) then |
176 if (not isMap and ((Land[t, i] and lfIndestructible) = 0)) or ((Land[t, i] and lfBasic) <> 0) then |
173 if (cReducedQuality and rqBlurryLand) = 0 then |
177 if (cReducedQuality and rqBlurryLand) = 0 then |
174 LandPixels[y - dx, i]:= 0 |
178 LandPixels[t, i]:= 0 |
175 else |
179 else |
176 LandPixels[(y - dx) div 2, i div 2]:= 0; |
180 LandPixels[t div 2, i div 2]:= 0; |
177 |
181 |
178 end; |
182 end; |
179 |
183 |
180 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt); |
184 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt); |
181 var i: LongInt; |
185 var i, t: LongInt; |
182 begin |
186 begin |
183 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
187 t:= y + dy; |
|
188 if (t and LAND_HEIGHT_MASK) = 0 then |
184 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
189 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
185 if ((Land[y + dy, i] and lfBasic) <> 0) then |
190 if ((Land[t, i] and lfBasic) <> 0) then |
186 if (cReducedQuality and rqBlurryLand) = 0 then |
191 if (cReducedQuality and rqBlurryLand) = 0 then |
187 LandPixels[y + dy, i]:= LandBackPixel(i, y + dy) |
192 LandPixels[t, i]:= LandBackPixel(i, t) |
188 else |
193 else |
189 LandPixels[(y + dy) div 2, i div 2]:= LandBackPixel(i, y + dy) |
194 LandPixels[t div 2, i div 2]:= LandBackPixel(i, t) |
190 else |
195 else |
191 if ((Land[y + dy, i] and lfObject) <> 0) then |
196 if ((Land[t, i] and lfObject) <> 0) then |
192 if (cReducedQuality and rqBlurryLand) = 0 then |
197 if (cReducedQuality and rqBlurryLand) = 0 then |
193 LandPixels[y + dy, i]:= 0 |
198 LandPixels[t, i]:= 0 |
194 else |
199 else |
195 LandPixels[(y + dy) div 2, i div 2]:= 0; |
200 LandPixels[t div 2, i div 2]:= 0; |
196 |
201 |
197 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
202 t:= y - dy; |
|
203 if (t and LAND_HEIGHT_MASK) = 0 then |
198 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
204 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
199 if ((Land[y - dy, i] and lfBasic) <> 0) then |
205 if ((Land[t, i] and lfBasic) <> 0) then |
200 if (cReducedQuality and rqBlurryLand) = 0 then |
206 if (cReducedQuality and rqBlurryLand) = 0 then |
201 LandPixels[y - dy, i]:= LandBackPixel(i, y - dy) |
207 LandPixels[t, i]:= LandBackPixel(i, t) |
202 else |
208 else |
203 LandPixels[(y - dy) div 2, i div 2]:= LandBackPixel(i, y - dy) |
209 LandPixels[t div 2, i div 2]:= LandBackPixel(i, t) |
204 else |
210 else |
205 if ((Land[y - dy, i] and lfObject) <> 0) then |
211 if ((Land[t, i] and lfObject) <> 0) then |
206 if (cReducedQuality and rqBlurryLand) = 0 then |
212 if (cReducedQuality and rqBlurryLand) = 0 then |
207 LandPixels[y - dy, i]:= 0 |
213 LandPixels[t, i]:= 0 |
208 else |
214 else |
209 LandPixels[(y - dy) div 2, i div 2]:= 0; |
215 LandPixels[t div 2, i div 2]:= 0; |
210 |
216 |
211 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
217 t:= y + dx; |
|
218 if (t and LAND_HEIGHT_MASK) = 0 then |
212 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
219 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
213 if ((Land[y + dx, i] and lfBasic) <> 0) then |
220 if ((Land[t, i] and lfBasic) <> 0) then |
214 if (cReducedQuality and rqBlurryLand) = 0 then |
221 if (cReducedQuality and rqBlurryLand) = 0 then |
215 LandPixels[y + dx, i]:= LandBackPixel(i, y + dx) |
222 LandPixels[t, i]:= LandBackPixel(i, t) |
216 else |
223 else |
217 LandPixels[(y + dx) div 2, i div 2]:= LandBackPixel(i, y + dx) |
224 LandPixels[t div 2, i div 2]:= LandBackPixel(i, t) |
218 else |
225 else |
219 if ((Land[y + dx, i] and lfObject) <> 0) then |
226 if ((Land[t, i] and lfObject) <> 0) then |
220 if (cReducedQuality and rqBlurryLand) = 0 then |
227 if (cReducedQuality and rqBlurryLand) = 0 then |
221 LandPixels[y + dx, i]:= 0 |
228 LandPixels[t, i]:= 0 |
222 else |
229 else |
223 LandPixels[(y + dx) div 2, i div 2]:= 0; |
230 LandPixels[t div 2, i div 2]:= 0; |
224 |
231 |
225 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
232 t:= y - dx; |
|
233 if (t and LAND_HEIGHT_MASK) = 0 then |
226 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
234 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
227 if ((Land[y - dx, i] and lfBasic) <> 0) then |
235 if ((Land[t, i] and lfBasic) <> 0) then |
228 if (cReducedQuality and rqBlurryLand) = 0 then |
236 if (cReducedQuality and rqBlurryLand) = 0 then |
229 LandPixels[y - dx, i]:= LandBackPixel(i, y - dx) |
237 LandPixels[t, i]:= LandBackPixel(i, t) |
230 else |
238 else |
231 LandPixels[(y - dx) div 2, i div 2]:= LandBackPixel(i, y - dx) |
239 LandPixels[t div 2, i div 2]:= LandBackPixel(i, t) |
232 |
240 |
233 else |
241 else |
234 if ((Land[y - dx, i] and lfObject) <> 0) then |
242 if ((Land[t, i] and lfObject) <> 0) then |
235 if (cReducedQuality and rqBlurryLand) = 0 then |
243 if (cReducedQuality and rqBlurryLand) = 0 then |
236 LandPixels[y - dx, i]:= 0 |
244 LandPixels[t, i]:= 0 |
237 else |
245 else |
238 LandPixels[(y - dx) div 2, i div 2]:= 0; |
246 LandPixels[t div 2, i div 2]:= 0; |
239 |
247 |
240 end; |
248 end; |
241 |
249 |
242 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
250 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
243 var i: LongInt; |
251 var i, t: LongInt; |
244 begin |
252 begin |
245 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
253 t:= y + dy; |
|
254 if (t and LAND_HEIGHT_MASK) = 0 then |
246 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
255 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
247 if ((Land[y + dy, i] and lfBasic) <> 0) or ((Land[y + dy, i] and lfObject) <> 0) then |
256 if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then |
248 begin |
257 begin |
249 if (cReducedQuality and rqBlurryLand) = 0 then |
258 if (cReducedQuality and rqBlurryLand) = 0 then |
250 LandPixels[y + dy, i]:= cExplosionBorderColor |
259 LandPixels[t, i]:= cExplosionBorderColor |
251 else |
260 else |
252 LandPixels[(y + dy) div 2, i div 2]:= cExplosionBorderColor; |
261 LandPixels[t div 2, i div 2]:= cExplosionBorderColor; |
253 |
262 |
254 Land[y + dy, i]:= Land[y + dy, i] or lfDamaged; |
263 Land[t, i]:= Land[t, i] or lfDamaged; |
255 Despeckle(i, y + dy); |
264 //Despeckle(i, t); |
256 LandDirty[(y + dy) div 32, i div 32]:= 1; |
265 LandDirty[t div 32, i div 32]:= 1; |
257 end; |
266 end; |
258 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
267 |
|
268 t:= y - dy; |
|
269 if (t and LAND_HEIGHT_MASK) = 0 then |
259 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
270 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
260 if ((Land[y - dy, i] and lfBasic) <> 0) or ((Land[y - dy, i] and lfObject) <> 0) then |
271 if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then |
261 begin |
272 begin |
262 if (cReducedQuality and rqBlurryLand) = 0 then |
273 if (cReducedQuality and rqBlurryLand) = 0 then |
263 LandPixels[y - dy, i]:= cExplosionBorderColor |
274 LandPixels[t, i]:= cExplosionBorderColor |
264 else |
275 else |
265 LandPixels[(y - dy) div 2, i div 2]:= cExplosionBorderColor; |
276 LandPixels[t div 2, i div 2]:= cExplosionBorderColor; |
266 Land[y - dy, i]:= Land[y - dy, i] or lfDamaged; |
277 Land[t, i]:= Land[t, i] or lfDamaged; |
267 Despeckle(i, y - dy); |
278 //Despeckle(i, t); |
268 LandDirty[(y - dy) div 32, i div 32]:= 1; |
279 LandDirty[t div 32, i div 32]:= 1; |
269 end; |
280 end; |
270 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
281 |
|
282 t:= y + dx; |
|
283 if (t and LAND_HEIGHT_MASK) = 0 then |
271 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
284 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
272 if ((Land[y + dx, i] and lfBasic) <> 0) or ((Land[y + dx, i] and lfObject) <> 0) then |
285 if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then |
273 begin |
286 begin |
274 if (cReducedQuality and rqBlurryLand) = 0 then |
287 if (cReducedQuality and rqBlurryLand) = 0 then |
275 LandPixels[y + dx, i]:= cExplosionBorderColor |
288 LandPixels[t, i]:= cExplosionBorderColor |
276 else |
289 else |
277 LandPixels[(y + dx) div 2, i div 2]:= cExplosionBorderColor; |
290 LandPixels[t div 2, i div 2]:= cExplosionBorderColor; |
278 |
291 |
279 Land[y + dx, i]:= Land[y + dx, i] or lfDamaged; |
292 Land[t, i]:= Land[t, i] or lfDamaged; |
280 Despeckle(i, y + dx); |
293 //Despeckle(i, t); |
281 LandDirty[(y + dx) div 32, i div 32]:= 1; |
294 LandDirty[t div 32, i div 32]:= 1; |
282 end; |
295 end; |
283 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
296 |
|
297 t:= y - dx; |
|
298 if (t and LAND_HEIGHT_MASK) = 0 then |
284 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
299 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
285 if ((Land[y - dx, i] and lfBasic) <> 0) or ((Land[y - dx, i] and lfObject) <> 0) then |
300 if ((Land[t, i] and lfBasic) <> 0) or ((Land[t, i] and lfObject) <> 0) then |
286 begin |
301 begin |
287 if (cReducedQuality and rqBlurryLand) = 0 then |
302 if (cReducedQuality and rqBlurryLand) = 0 then |
288 LandPixels[y - dx, i]:= cExplosionBorderColor |
303 LandPixels[t, i]:= cExplosionBorderColor |
289 else |
304 else |
290 LandPixels[(y - dx) div 2, i div 2]:= cExplosionBorderColor; |
305 LandPixels[t div 2, i div 2]:= cExplosionBorderColor; |
291 |
306 |
292 Land[y - dx, i]:= Land[y - dx, i] or lfDamaged; |
307 Land[t, i]:= Land[t, i] or lfDamaged; |
293 Despeckle(i, y - dy); |
308 //Despeckle(i, y - dy); |
294 LandDirty[(y - dx) div 32, i div 32]:= 1; |
309 LandDirty[t div 32, i div 32]:= 1; |
295 end; |
310 end; |
296 end; |
311 end; |
297 |
312 |
298 procedure DrawExplosion(X, Y, Radius: LongInt); |
313 procedure DrawExplosion(X, Y, Radius: LongInt); |
299 var dx, dy, ty, tx, d: LongInt; |
314 var dx, dy, ty, tx, d: LongInt; |