hedgewars/GSHandlers.inc
changeset 4803 eddea6bca770
parent 4802 4c1041eef577
child 4805 01332828b568
equal deleted inserted replaced
4802:4c1041eef577 4803:eddea6bca770
   598 
   598 
   599         move:= false;
   599         move:= false;
   600     // move back to cloud layer
   600     // move back to cloud layer
   601         if yy > cWaterLine then move:= true
   601         if yy > cWaterLine then move:= true
   602         else if ((yy and LAND_HEIGHT_MASK) <> 0) or ((xx and LAND_WIDTH_MASK) <> 0) then move:=true
   602         else if ((yy and LAND_HEIGHT_MASK) <> 0) or ((xx and LAND_WIDTH_MASK) <> 0) then move:=true
   603         // Hog encountered
   603         // Hog/Object encountered
   604         else if ((Land[yy, xx] and $FF) <> 0) then move:=true
   604         else if ((Land[yy, xx] and $FF) <> 0) then move:=true
   605         // Solid pixel encountered
   605         // Solid pixel encountered
   606         else if (Land[yy, xx] > 255) then
   606         else if (Land[yy, xx] > 255) then
   607             begin
   607             begin
   608             // If there's room below keep falling
   608             // If there's room below keep falling
   646                     for py:= 0 to Pred(s^.h) do
   646                     for py:= 0 to Pred(s^.h) do
   647                         begin
   647                         begin
   648                         for px:= 0 to Pred(s^.w) do
   648                         for px:= 0 to Pred(s^.w) do
   649                             if ((((yy + py) and LAND_HEIGHT_MASK) = 0) and (((xx + px) and LAND_WIDTH_MASK) = 0)) and ((Land[yy + py, xx + px] and $FF) = 0) then
   649                             if ((((yy + py) and LAND_HEIGHT_MASK) = 0) and (((xx + px) and LAND_WIDTH_MASK) = 0)) and ((Land[yy + py, xx + px] and $FF) = 0) then
   650                                 begin
   650                                 begin
       
   651                                 Land[yy + py, xx + px]:= Land[yy + py, xx + px] or lfObject;
   651                                 if (cReducedQuality and rqBlurryLand) = 0 then
   652                                 if (cReducedQuality and rqBlurryLand) = 0 then
   652                                     begin
   653                                     begin
   653                                     LandPixels[yy + py, xx + px]:= addBgColor(LandPixels[yy + py, xx + px], p^[px]);
   654                                     LandPixels[yy + py, xx + px]:= addBgColor(LandPixels[yy + py, xx + px], p^[px]);
   654                                     Land[yy + py, xx + px]:= Land[yy + py, xx + px] or lfObject;
       
   655                                     end
   655                                     end
   656                                 else
   656                                 else
   657                                     begin
   657                                     begin
   658                                     LandPixels[(yy + py) div 2, (xx + px) div 2]:= addBgColor(LandPixels[(yy + py) div 2, (xx + px) div 2], p^[px]);
   658                                     LandPixels[(yy + py) div 2, (xx + px) div 2]:= addBgColor(LandPixels[(yy + py) div 2, (xx + px) div 2], p^[px]);
   659                                     Land[(yy + py) div 2, (xx + px) div 2]:= Land[(yy + py) div 2, (xx + px) div 2] or lfObject;
       
   660                                     end;
   659                                     end;
   661                                 end
   660                                 end
   662                             else allpx:= false;
   661                             else allpx:= false;
   663                         p:= @(p^[s^.pitch shr 2])
   662                         p:= @(p^[s^.pitch shr 2])
   664                         end;
   663                         end;