44 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
44 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
45 var i: LongInt; |
45 var i: LongInt; |
46 begin |
46 begin |
47 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
47 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
48 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
48 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
49 if (Land[y + dy, i] and LAND_INDESTRUCTIBLE) = 0 then |
49 if (Land[y + dy, i] and lfIndestructible) = 0 then |
50 Land[y + dy, i]:= Value; |
50 Land[y + dy, i]:= Value; |
51 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
51 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
52 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
52 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
53 if (Land[y - dy, i] and LAND_INDESTRUCTIBLE) = 0 then |
53 if (Land[y - dy, i] and lfIndestructible) = 0 then |
54 Land[y - dy, i]:= Value; |
54 Land[y - dy, i]:= Value; |
55 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
55 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
56 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
56 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
57 if (Land[y + dx, i] and LAND_INDESTRUCTIBLE) = 0 then |
57 if (Land[y + dx, i] and lfIndestructible) = 0 then |
58 Land[y + dx, i]:= Value; |
58 Land[y + dx, i]:= Value; |
59 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
59 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
60 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
60 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
61 if (Land[y - dx, i] and LAND_INDESTRUCTIBLE) = 0 then |
61 if (Land[y - dx, i] and lfIndestructible) = 0 then |
62 Land[y - dx, i]:= Value; |
62 Land[y - dx, i]:= Value; |
63 end; |
63 end; |
64 |
64 |
65 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean); |
65 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean); |
66 var i: LongInt; |
66 var i: LongInt; |
143 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
143 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
144 var i: LongInt; |
144 var i: LongInt; |
145 begin |
145 begin |
146 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
146 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
147 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 |
148 if (not isMap and ((Land[y + dy, i] and LAND_INDESTRUCTIBLE) = 0)) or ((Land[y + dy, i] and LAND_BASIC) <> 0) then |
148 if (not isMap and ((Land[y + dy, i] and lfIndestructible) = 0)) or ((Land[y + dy, i] and lfBasic) <> 0) then |
149 {$IFDEF DOWNSCALE} |
149 {$IFDEF DOWNSCALE} |
150 LandPixels[(y + dy) div 2, i div 2]:= 0; |
150 LandPixels[(y + dy) div 2, i div 2]:= 0; |
151 {$ELSE} |
151 {$ELSE} |
152 LandPixels[y + dy, i]:= 0; |
152 LandPixels[y + dy, i]:= 0; |
153 {$ENDIF} |
153 {$ENDIF} |
154 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
154 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
155 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 |
156 if (not isMap and ((Land[y - dy, i] and LAND_INDESTRUCTIBLE) = 0)) or ((Land[y - dy, i] and LAND_BASIC) <> 0) then |
156 if (not isMap and ((Land[y - dy, i] and lfIndestructible) = 0)) or ((Land[y - dy, i] and lfBasic) <> 0) then |
157 {$IFDEF DOWNSCALE} |
157 {$IFDEF DOWNSCALE} |
158 LandPixels[(y - dy) div 2, i div 2]:= 0; |
158 LandPixels[(y - dy) div 2, i div 2]:= 0; |
159 {$ELSE} |
159 {$ELSE} |
160 LandPixels[y - dy, i]:= 0; |
160 LandPixels[y - dy, i]:= 0; |
161 {$ENDIF} |
161 {$ENDIF} |
162 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
162 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
163 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 |
164 if (not isMap and ((Land[y + dx, i] and LAND_INDESTRUCTIBLE) = 0)) or ((Land[y + dx, i] and LAND_BASIC) <> 0) then |
164 if (not isMap and ((Land[y + dx, i] and lfIndestructible) = 0)) or ((Land[y + dx, i] and lfBasic) <> 0) then |
165 {$IFDEF DOWNSCALE} |
165 {$IFDEF DOWNSCALE} |
166 LandPixels[(y + dx) div 2, i div 2]:= 0; |
166 LandPixels[(y + dx) div 2, i div 2]:= 0; |
167 {$ELSE} |
167 {$ELSE} |
168 LandPixels[y + dx, i]:= 0; |
168 LandPixels[y + dx, i]:= 0; |
169 {$ENDIF} |
169 {$ENDIF} |
170 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
170 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
171 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 |
172 if (not isMap and ((Land[y - dx, i] and LAND_INDESTRUCTIBLE) = 0)) or ((Land[y - dx, i] and LAND_BASIC) <> 0) then |
172 if (not isMap and ((Land[y - dx, i] and lfIndestructible) = 0)) or ((Land[y - dx, i] and lfBasic) <> 0) then |
173 {$IFDEF DOWNSCALE} |
173 {$IFDEF DOWNSCALE} |
174 LandPixels[(y - dx) div 2, i div 2]:= 0; |
174 LandPixels[(y - dx) div 2, i div 2]:= 0; |
175 {$ELSE} |
175 {$ELSE} |
176 LandPixels[y - dx, i]:= 0; |
176 LandPixels[y - dx, i]:= 0; |
177 {$ENDIF} |
177 {$ENDIF} |
180 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt); |
180 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt); |
181 var i: LongInt; |
181 var i: LongInt; |
182 begin |
182 begin |
183 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
183 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
184 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 |
185 if ((Land[y + dy, i] and LAND_BASIC) <> 0) then |
185 if ((Land[y + dy, i] and lfBasic) <> 0) then |
186 {$IFDEF DOWNSCALE} |
186 {$IFDEF DOWNSCALE} |
187 LandPixels[(y + dy) div 2, i div 2]:= LandBackPixel(i, y + dy) |
187 LandPixels[(y + dy) div 2, i div 2]:= LandBackPixel(i, y + dy) |
188 {$ELSE} |
188 {$ELSE} |
189 LandPixels[y + dy, i]:= LandBackPixel(i, y + dy) |
189 LandPixels[y + dy, i]:= LandBackPixel(i, y + dy) |
190 {$ENDIF} |
190 {$ENDIF} |
191 else |
191 else |
192 {$IFDEF DOWNSCALE} |
192 {$IFDEF DOWNSCALE} |
193 if ((Land[y + dy, i] and LAND_OBJECT) <> 0) then LandPixels[(y + dy) div 2, i div 2]:= 0; |
193 if ((Land[y + dy, i] and lfObject) <> 0) then LandPixels[(y + dy) div 2, i div 2]:= 0; |
194 {$ELSE} |
194 {$ELSE} |
195 if ((Land[y + dy, i] and LAND_OBJECT) <> 0) then LandPixels[y + dy, i]:= 0; |
195 if ((Land[y + dy, i] and lfObject) <> 0) then LandPixels[y + dy, i]:= 0; |
196 {$ENDIF} |
196 {$ENDIF} |
197 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
197 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
198 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 |
199 if ((Land[y - dy, i] and LAND_BASIC) <> 0) then |
199 if ((Land[y - dy, i] and lfBasic) <> 0) then |
200 {$IFDEF DOWNSCALE} |
200 {$IFDEF DOWNSCALE} |
201 LandPixels[(y - dy) div 2, i div 2]:= LandBackPixel(i, y - dy) |
201 LandPixels[(y - dy) div 2, i div 2]:= LandBackPixel(i, y - dy) |
202 {$ELSE} |
202 {$ELSE} |
203 LandPixels[y - dy, i]:= LandBackPixel(i, y - dy) |
203 LandPixels[y - dy, i]:= LandBackPixel(i, y - dy) |
204 {$ENDIF} |
204 {$ENDIF} |
205 else |
205 else |
206 {$IFDEF DOWNSCALE} |
206 {$IFDEF DOWNSCALE} |
207 if ((Land[y - dy, i] and LAND_OBJECT) <> 0) then LandPixels[(y - dy) div 2, i div 2]:= 0; |
207 if ((Land[y - dy, i] and lfObject) <> 0) then LandPixels[(y - dy) div 2, i div 2]:= 0; |
208 {$ELSE} |
208 {$ELSE} |
209 if ((Land[y - dy, i] and LAND_OBJECT) <> 0) then LandPixels[y - dy, i]:= 0; |
209 if ((Land[y - dy, i] and lfObject) <> 0) then LandPixels[y - dy, i]:= 0; |
210 {$ENDIF} |
210 {$ENDIF} |
211 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
211 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
212 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 |
213 if ((Land[y + dx, i] and LAND_BASIC) <> 0) then |
213 if ((Land[y + dx, i] and lfBasic) <> 0) then |
214 {$IFDEF DOWNSCALE} |
214 {$IFDEF DOWNSCALE} |
215 LandPixels[(y + dx) div 2, i div 2]:= LandBackPixel(i, y + dx) |
215 LandPixels[(y + dx) div 2, i div 2]:= LandBackPixel(i, y + dx) |
216 {$ELSE} |
216 {$ELSE} |
217 LandPixels[y + dx, i]:= LandBackPixel(i, y + dx) |
217 LandPixels[y + dx, i]:= LandBackPixel(i, y + dx) |
218 {$ENDIF} |
218 {$ENDIF} |
219 else |
219 else |
220 {$IFDEF DOWNSCALE} |
220 {$IFDEF DOWNSCALE} |
221 if ((Land[y + dx, i] and LAND_OBJECT) <> 0) then LandPixels[(y + dx) div 2, i div 2]:= 0; |
221 if ((Land[y + dx, i] and lfObject) <> 0) then LandPixels[(y + dx) div 2, i div 2]:= 0; |
222 {$ELSE} |
222 {$ELSE} |
223 if ((Land[y + dx, i] and LAND_OBJECT) <> 0) then LandPixels[y + dx, i]:= 0; |
223 if ((Land[y + dx, i] and lfObject) <> 0) then LandPixels[y + dx, i]:= 0; |
224 {$ENDIF} |
224 {$ENDIF} |
225 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
225 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
226 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 |
227 if ((Land[y - dx, i] and LAND_BASIC) <> 0) then |
227 if ((Land[y - dx, i] and lfBasic) <> 0) then |
228 {$IFDEF DOWNSCALE} |
228 {$IFDEF DOWNSCALE} |
229 LandPixels[(y - dx) div 2, i div 2]:= LandBackPixel(i, y - dx) |
229 LandPixels[(y - dx) div 2, i div 2]:= LandBackPixel(i, y - dx) |
230 {$ELSE} |
230 {$ELSE} |
231 LandPixels[y - dx, i]:= LandBackPixel(i, y - dx) |
231 LandPixels[y - dx, i]:= LandBackPixel(i, y - dx) |
232 {$ENDIF} |
232 {$ENDIF} |
233 else |
233 else |
234 {$IFDEF DOWNSCALE} |
234 {$IFDEF DOWNSCALE} |
235 if ((Land[y - dx, i] and LAND_OBJECT) <> 0) then LandPixels[(y - dx) div 2, i div 2]:= 0; |
235 if ((Land[y - dx, i] and lfObject) <> 0) then LandPixels[(y - dx) div 2, i div 2]:= 0; |
236 {$ELSE} |
236 {$ELSE} |
237 if ((Land[y - dx, i] and LAND_OBJECT) <> 0) then LandPixels[y - dx, i]:= 0; |
237 if ((Land[y - dx, i] and lfObject) <> 0) then LandPixels[y - dx, i]:= 0; |
238 {$ENDIF} |
238 {$ENDIF} |
239 end; |
239 end; |
240 |
240 |
241 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
241 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
242 var i: LongInt; |
242 var i: LongInt; |
243 begin |
243 begin |
244 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
244 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
245 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
245 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
246 if ((Land[y + dy, i] and LAND_BASIC) <> 0) or ((Land[y + dy, i] and LAND_OBJECT) <> 0) then |
246 if ((Land[y + dy, i] and lfBasic) <> 0) or ((Land[y + dy, i] and lfObject) <> 0) then |
247 begin |
247 begin |
248 {$IFDEF DOWNSCALE} |
248 {$IFDEF DOWNSCALE} |
249 LandPixels[(y + dy) div 2, i div 2]:= cExplosionBorderColor; |
249 LandPixels[(y + dy) div 2, i div 2]:= cExplosionBorderColor; |
250 {$ELSE} |
250 {$ELSE} |
251 LandPixels[y + dy, i]:= cExplosionBorderColor; |
251 LandPixels[y + dy, i]:= cExplosionBorderColor; |
252 {$ENDIF} |
252 {$ENDIF} |
253 Land[y + dy, i]:= Land[y + dy, i] or LAND_DAMAGED; |
253 Land[y + dy, i]:= Land[y + dy, i] or lfDamaged; |
254 Despeckle(i, y + dy); |
254 Despeckle(i, y + dy); |
255 LandDirty[(y + dy) div 32, i div 32]:= 1; |
255 LandDirty[(y + dy) div 32, i div 32]:= 1; |
256 end; |
256 end; |
257 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
257 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
258 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 |
259 if ((Land[y - dy, i] and LAND_BASIC) <> 0) or ((Land[y - dy, i] and LAND_OBJECT) <> 0) then |
259 if ((Land[y - dy, i] and lfBasic) <> 0) or ((Land[y - dy, i] and lfObject) <> 0) then |
260 begin |
260 begin |
261 {$IFDEF DOWNSCALE} |
261 {$IFDEF DOWNSCALE} |
262 LandPixels[(y - dy) div 2, i div 2]:= cExplosionBorderColor; |
262 LandPixels[(y - dy) div 2, i div 2]:= cExplosionBorderColor; |
263 {$ELSE} |
263 {$ELSE} |
264 LandPixels[y - dy, i]:= cExplosionBorderColor; |
264 LandPixels[y - dy, i]:= cExplosionBorderColor; |
265 {$ENDIF} |
265 {$ENDIF} |
266 Land[y - dy, i]:= Land[y - dy, i] or LAND_DAMAGED; |
266 Land[y - dy, i]:= Land[y - dy, i] or lfDamaged; |
267 Despeckle(i, y - dy); |
267 Despeckle(i, y - dy); |
268 LandDirty[(y - dy) div 32, i div 32]:= 1; |
268 LandDirty[(y - dy) div 32, i div 32]:= 1; |
269 end; |
269 end; |
270 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
270 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
271 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
271 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
272 if ((Land[y + dx, i] and LAND_BASIC) <> 0) or ((Land[y + dx, i] and LAND_OBJECT) <> 0) then |
272 if ((Land[y + dx, i] and lfBasic) <> 0) or ((Land[y + dx, i] and lfObject) <> 0) then |
273 begin |
273 begin |
274 {$IFDEF DOWNSCALE} |
274 {$IFDEF DOWNSCALE} |
275 LandPixels[(y + dx) div 2, i div 2]:= cExplosionBorderColor; |
275 LandPixels[(y + dx) div 2, i div 2]:= cExplosionBorderColor; |
276 {$ELSE} |
276 {$ELSE} |
277 LandPixels[y + dx, i]:= cExplosionBorderColor; |
277 LandPixels[y + dx, i]:= cExplosionBorderColor; |
278 {$ENDIF} |
278 {$ENDIF} |
279 Land[y + dx, i]:= Land[y + dx, i] or LAND_DAMAGED; |
279 Land[y + dx, i]:= Land[y + dx, i] or lfDamaged; |
280 Despeckle(i, y + dx); |
280 Despeckle(i, y + dx); |
281 LandDirty[(y + dx) div 32, i div 32]:= 1; |
281 LandDirty[(y + dx) div 32, i div 32]:= 1; |
282 end; |
282 end; |
283 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
283 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
284 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 |
285 if ((Land[y - dx, i] and LAND_BASIC) <> 0) or ((Land[y - dx, i] and LAND_OBJECT) <> 0) then |
285 if ((Land[y - dx, i] and lfBasic) <> 0) or ((Land[y - dx, i] and lfObject) <> 0) then |
286 begin |
286 begin |
287 {$IFDEF DOWNSCALE} |
287 {$IFDEF DOWNSCALE} |
288 LandPixels[(y - dx) div 2, i div 2]:= cExplosionBorderColor; |
288 LandPixels[(y - dx) div 2, i div 2]:= cExplosionBorderColor; |
289 {$ELSE} |
289 {$ELSE} |
290 LandPixels[y - dx, i]:= cExplosionBorderColor; |
290 LandPixels[y - dx, i]:= cExplosionBorderColor; |
291 {$ENDIF} |
291 {$ENDIF} |
292 Land[y - dx, i]:= Land[y - dx, i] or LAND_DAMAGED; |
292 Land[y - dx, i]:= Land[y - dx, i] or lfDamaged; |
293 Despeckle(i, y - dy); |
293 Despeckle(i, y - dy); |
294 LandDirty[(y - dx) div 32, i div 32]:= 1; |
294 LandDirty[(y - dx) div 32, i div 32]:= 1; |
295 end; |
295 end; |
296 end; |
296 end; |
297 |
297 |