hedgewars/uLandGraphics.pas
changeset 2981 d0471586a616
parent 2948 3f21a9dc93d0
child 3236 4ab3917d7d44
equal deleted inserted replaced
2980:3cbd5a39aaee 2981:d0471586a616
   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 (Land[y + dy, i] <> COLOR_INDESTRUCTIBLE) then
   148         if (not isMap and (Land[y + dy, i] <> COLOR_INDESTRUCTIBLE)) or (Land[y + dy, i] = COLOR_LAND) then
   149             LandPixels[y + dy, i]:= 0;
   149             LandPixels[y + dy, i]:= 0;
   150 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   150 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
   151     for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
   151     for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
   152         if (Land[y - dy, i] <> COLOR_INDESTRUCTIBLE) then
   152         if (not isMap and (Land[y - dy, i] <> COLOR_INDESTRUCTIBLE)) or (Land[y - dy, i] = COLOR_LAND) then
   153              LandPixels[y - dy, i]:= 0;
   153              LandPixels[y - dy, i]:= 0;
   154 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   154 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
   155     for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
   155     for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
   156         if (Land[y + dx, i] <> COLOR_INDESTRUCTIBLE) then
   156         if (not isMap and (Land[y + dx, i] <> COLOR_INDESTRUCTIBLE)) or (Land[y + dx, i] = COLOR_LAND) then
   157             LandPixels[y + dx, i]:= 0;
   157             LandPixels[y + dx, i]:= 0;
   158 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   158 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
   159     for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
   159     for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
   160         if (Land[y - dx, i] <> COLOR_INDESTRUCTIBLE) then
   160         if (not isMap and (Land[y - dx, i] <> COLOR_INDESTRUCTIBLE)) or (Land[y - dx, i] = COLOR_LAND) then
   161              LandPixels[y - dx, i]:= 0;
   161              LandPixels[y - dx, i]:= 0;
   162 end;
   162 end;
   163 
   163 
   164 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt);
   164 procedure FillLandCircleLinesBG(x, y, dx, dy: LongInt);
   165 var i: LongInt;
   165 var i: LongInt;
   521 
   521 
   522 // was experimenting with applying as damage occurred.
   522 // was experimenting with applying as damage occurred.
   523 function Despeckle(X, Y: LongInt): boolean;
   523 function Despeckle(X, Y: LongInt): boolean;
   524 var nx, ny, i, j, c: LongInt;
   524 var nx, ny, i, j, c: LongInt;
   525 begin
   525 begin
   526 if (Land[Y, X] <> 0) and (Land[Y, X] <> COLOR_INDESTRUCTIBLE) and (LandPixels[Y, X] = cExplosionBorderColor)then // check neighbours
   526 if (Land[Y, X] > 255) and (Land[Y, X] <> COLOR_INDESTRUCTIBLE) and (LandPixels[Y, X] = cExplosionBorderColor)then // check neighbours
   527     begin
   527     begin
   528     c:= 0;
   528     c:= 0;
   529     for i:= -1 to 1 do
   529     for i:= -1 to 1 do
   530         for j:= -1 to 1 do
   530         for j:= -1 to 1 do
   531             if (i <> 0) or (j <> 0) then
   531             if (i <> 0) or (j <> 0) then