hedgewars/uLandGraphics.pas
changeset 10152 15e9bb6fcab2
parent 10138 1a71d28392cb
child 10244 f7b5b4b88171
equal deleted inserted replaced
10150:fa5c83fd0ad9 10152:15e9bb6fcab2
    77         begin
    77         begin
    78             LandPixels[pixelY, pixelX]:= LandBackPixel(landX, landY);
    78             LandPixels[pixelY, pixelX]:= LandBackPixel(landX, landY);
    79             inc(drawPixelBG);
    79             inc(drawPixelBG);
    80         end
    80         end
    81         else if ((Land[landY, landX] and lfObject) <> 0) or (((LandPixels[pixelY, pixelX] and AMask) shr AShift) < 255) then
    81         else if ((Land[landY, landX] and lfObject) <> 0) or (((LandPixels[pixelY, pixelX] and AMask) shr AShift) < 255) then
    82             LandPixels[pixelY, pixelX]:= 0
    82             LandPixels[pixelY, pixelX]:= LandPixels[pixelY, pixelX] and (not AMASK)
    83     end;
    83     end;
    84 end;
    84 end;
    85 
    85 
    86 procedure drawPixelEBC(landX, landY, pixelX, pixelY: Longint); inline;
    86 procedure drawPixelEBC(landX, landY, pixelX, pixelY: Longint); inline;
    87 begin
    87 begin
   194     nullPixel:
   194     nullPixel:
   195         for i:= fromPix to toPix do
   195         for i:= fromPix to toPix do
   196             begin
   196             begin
   197             calculatePixelsCoordinates(i, y, px, py);
   197             calculatePixelsCoordinates(i, y, px, py);
   198             if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255))  then
   198             if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255))  then
   199                 LandPixels[py, px]:= 0
   199                 LandPixels[py, px]:= LandPixels[py, px] and (not AMASK);
   200             end;
   200             end;
   201     icePixel:
   201     icePixel:
   202         for i:= fromPix to toPix do
   202         for i:= fromPix to toPix do
   203             begin
   203             begin
   204             calculatePixelsCoordinates(i, y, px, py);
   204             calculatePixelsCoordinates(i, y, px, py);
   413                     by:= ty div 2; bx:= tx div 2;
   413                     by:= ty div 2; bx:= tx div 2;
   414                     end;
   414                     end;
   415                 if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
   415                 if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
   416                     LandPixels[by, bx]:= LandBackPixel(tx, ty)
   416                     LandPixels[by, bx]:= LandBackPixel(tx, ty)
   417                 else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   417                 else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   418                     LandPixels[by, bx]:= 0
   418                     LandPixels[by, bx]:= LandPixels[by, bx] and (not AMASK)
   419                 end
   419                 end
   420             end;
   420             end;
   421     inc(y, dY)
   421     inc(y, dY)
   422     end;
   422     end;
   423 
   423 
   544                 by:= ty div 2; bx:= tx div 2;
   544                 by:= ty div 2; bx:= tx div 2;
   545                 end;
   545                 end;
   546             if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
   546             if ((Land[ty, tx] and lfBasic) <> 0) and (((LandPixels[by,bx] and AMask) shr AShift) = 255) and (not disableLandBack) then
   547                 LandPixels[by, bx]:= LandBackPixel(tx, ty)
   547                 LandPixels[by, bx]:= LandBackPixel(tx, ty)
   548             else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   548             else if ((Land[ty, tx] and lfObject) <> 0) or (((LandPixels[by,bx] and AMask) shr AShift) < 255) then
   549                 LandPixels[by, bx]:= 0;
   549                 LandPixels[by, bx]:= LandPixels[by, bx] and (not AMASK);
   550             Land[ty, tx]:= 0;
   550             Land[ty, tx]:= 0;
   551             end
   551             end
   552         end;
   552         end;
   553     DrawExplosionBorder(X, Y, dx, dy, despeckle);
   553     DrawExplosionBorder(X, Y, dx, dy, despeckle);
   554     nx:= nx - dY;
   554     nx:= nx - dY;
   730         if c < 4 then // 0-3 neighbours
   730         if c < 4 then // 0-3 neighbours
   731         begin
   731         begin
   732             if ((Land[Y, X] and lfBasic) <> 0) and (not disableLandBack) then
   732             if ((Land[Y, X] and lfBasic) <> 0) and (not disableLandBack) then
   733                 LandPixels[yy, xx]:= LandBackPixel(X, Y)
   733                 LandPixels[yy, xx]:= LandBackPixel(X, Y)
   734             else
   734             else
   735                 LandPixels[yy, xx]:= 0;
   735                 LandPixels[yy, xx]:= LandPixels[yy, xx] and (not AMASK);
   736 
   736 
   737             if not pixelsweep then
   737             if not pixelsweep then
   738             begin
   738             begin
   739                 Land[Y, X]:= 0;
   739                 Land[Y, X]:= 0;
   740                 exit
   740                 exit