42 |
42 |
43 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
43 procedure FillCircleLines(x, y, dx, dy: LongInt; Value: Longword); |
44 var i: LongInt; |
44 var i: LongInt; |
45 begin |
45 begin |
46 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
46 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
47 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
47 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
48 if Land[y + dy, i] <> COLOR_INDESTRUCTIBLE then |
48 if Land[y + dy, i] <> COLOR_INDESTRUCTIBLE then |
49 Land[y + dy, i]:= Value; |
49 Land[y + dy, i]:= Value; |
50 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
50 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
51 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
51 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
52 if Land[y - dy, i] <> COLOR_INDESTRUCTIBLE then |
52 if Land[y - dy, i] <> COLOR_INDESTRUCTIBLE then |
53 Land[y - dy, i]:= Value; |
53 Land[y - dy, i]:= Value; |
54 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
54 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
55 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
55 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
56 if Land[y + dx, i] <> COLOR_INDESTRUCTIBLE then |
56 if Land[y + dx, i] <> COLOR_INDESTRUCTIBLE then |
57 Land[y + dx, i]:= Value; |
57 Land[y + dx, i]:= Value; |
58 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
58 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
59 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
59 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
60 if Land[y - dx, i] <> COLOR_INDESTRUCTIBLE then |
60 if Land[y - dx, i] <> COLOR_INDESTRUCTIBLE then |
61 Land[y - dx, i]:= Value; |
61 Land[y - dx, i]:= Value; |
62 end; |
62 end; |
63 |
63 |
64 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean); |
64 procedure ChangeCircleLines(x, y, dx, dy: LongInt; doSet: boolean); |
79 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
79 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
80 if (Land[y - dx, i] > 0) and (Land[y - dx, i] < 256) then dec(Land[y - dx, i]); |
80 if (Land[y - dx, i] > 0) and (Land[y - dx, i] < 256) then dec(Land[y - dx, i]); |
81 end else |
81 end else |
82 begin |
82 begin |
83 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
83 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
84 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
84 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
85 if (Land[y + dy, i] < 256) then |
85 if (Land[y + dy, i] < 256) then |
86 inc(Land[y + dy, i]); |
86 inc(Land[y + dy, i]); |
87 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
87 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
88 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
88 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
89 if (Land[y - dy, i] < 256) then |
89 if (Land[y - dy, i] < 256) then |
90 inc(Land[y - dy, i]); |
90 inc(Land[y - dy, i]); |
91 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
91 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
92 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
92 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
93 if (Land[y + dx, i] < 256) then |
93 if (Land[y + dx, i] < 256) then |
141 |
141 |
142 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
142 procedure FillLandCircleLines0(x, y, dx, dy: LongInt); |
143 var i: LongInt; |
143 var i: LongInt; |
144 begin |
144 begin |
145 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
145 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
146 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
146 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
147 if Land[y + dy, i] = COLOR_LAND then |
147 if Land[y + dy, i] = COLOR_LAND then |
148 LandPixels[y + dy, i]:= 0; |
148 LandPixels[y + dy, i]:= 0; |
149 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
149 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
150 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
150 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
151 if Land[y - dy, i] = COLOR_LAND then |
151 if Land[y - dy, i] = COLOR_LAND then |
152 LandPixels[y - dy, i]:= 0; |
152 LandPixels[y - dy, i]:= 0; |
153 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
153 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
154 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
154 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
155 if Land[y + dx, i] = COLOR_LAND then |
155 if Land[y + dx, i] = COLOR_LAND then |
156 LandPixels[y + dx, i]:= 0; |
156 LandPixels[y + dx, i]:= 0; |
157 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
157 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
158 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
158 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
159 if Land[y - dx, i] = COLOR_LAND then |
159 if Land[y - dx, i] = COLOR_LAND then |
160 LandPixels[y - dx, i]:= 0; |
160 LandPixels[y - dx, i]:= 0; |
161 end; |
161 end; |
162 |
162 |
163 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
163 procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt); |
164 var i: LongInt; |
164 var i: LongInt; |
165 begin |
165 begin |
166 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
166 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
167 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
167 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
168 if Land[y + dy, i] = COLOR_LAND then |
168 if Land[y + dy, i] = COLOR_LAND then |
169 begin |
169 begin |
170 LandPixels[y + dy, i]:= cExplosionBorderColor; |
170 LandPixels[y + dy, i]:= cExplosionBorderColor; |
171 // Despeckle(y + dy, i); |
171 // Despeckle(y + dy, i); |
172 LandDirty[(y + dy) div 32, i div 32]:= 1; |
172 LandDirty[(y + dy) div 32, i div 32]:= 1; |
173 end; |
173 end; |