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