hedgewars/uLandObjects.pas
changeset 13858 664935d80668
parent 13506 bdac56fb6f1a
child 14303 6015b74eea55
equal deleted inserted replaced
13857:10a3b80130b5 13858:664935d80668
   202                 pLandColor:= @LandPixels[cpY + y, cpX + x]
   202                 pLandColor:= @LandPixels[cpY + y, cpX + x]
   203             else
   203             else
   204                 pLandColor:= @LandPixels[(cpY + y) div 2, (cpX + x) div 2];
   204                 pLandColor:= @LandPixels[(cpY + y) div 2, (cpX + x) div 2];
   205 
   205 
   206             alpha:= (color and AMask) shr AShift;
   206             alpha:= (color and AMask) shr AShift;
   207             if (alpha <> $FF) and (pLandColor^ <> 0) then
   207             if ((alpha <> $FF) and ((pLandColor^) <> 0)) then
   208                 begin
   208                 begin
   209                 landColor:= pLandColor^;
   209                 landColor:= pLandColor^;
   210                 color:=
   210                 color:=
   211                     (LerpByte((landColor and RMask) shr RShift, (color and RMask) shr RShift, alpha) shl RShift)
   211                     (LerpByte((landColor and RMask) shr RShift, (color and RMask) shr RShift, alpha) shl RShift)
   212                  or (LerpByte((landColor and GMask) shr GShift, (color and GMask) shr GShift, alpha) shl GShift)
   212                  or (LerpByte((landColor and GMask) shr GShift, (color and GMask) shr GShift, alpha) shl GShift)