hedgewars/GSHandlers.inc
changeset 4625 f3ff30611c75
parent 4621 1d45bf63f25c
child 4627 578bc729d9c6
equal deleted inserted replaced
4623:fa24dac6c473 4625:f3ff30611c75
   597 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   597 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   598             if cWindSpeed * 1600 + dX < _0 then i:= -1
   598             if cWindSpeed * 1600 + dX < _0 then i:= -1
   599             else i:= 1;
   599             else i:= 1;
   600             if (yy > 0) and ((Land[yy-1, xx] and $FF00) = 0) then dec(yy)
   600             if (yy > 0) and ((Land[yy-1, xx] and $FF00) = 0) then dec(yy)
   601             else dec(xx, i);
   601             else dec(xx, i);
   602             if ((xx and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx]:= Land[yy, xx] or lfBasic;
       
   603             if yy > 0 then
       
   604                 begin 
       
   605                 Land[yy-1, xx]:= Land[yy-1, xx] or lfBasic;
       
   606                 if ((xx-i and LAND_WIDTH_MASK) = 0) then Land[yy-1, xx-i]:= Land[yy-1, xx-i] or lfBasic;
       
   607                 end;
       
   608             if ((xx-i and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx-i]:= Land[yy, xx-i] or lfBasic;
       
   609             dec(yy,4);
   602             dec(yy,4);
   610             dec(xx,i);
   603             dec(xx,i);
   611             if (((cReducedQuality and rqBlurryLand) = 0) and 
   604             if (((cReducedQuality and rqBlurryLand) = 0) and 
   612                     (xx >= 0) and (xx < LAND_WIDTH-4) and (yy >= 0) and (yy < LAND_HEIGHT)) or
   605                     (xx >= 0) and (xx < LAND_WIDTH-4) and (yy >= 0) and (yy < LAND_HEIGHT)) or
   613                (((cReducedQuality and rqBlurryLand) <> 0) and
   606                (((cReducedQuality and rqBlurryLand) <> 0) and
   617                 p:= s^.pixels;
   610                 p:= s^.pixels;
   618 
   611 
   619                 for py:= 0 to Pred(s^.h) do
   612                 for py:= 0 to Pred(s^.h) do
   620                     begin
   613                     begin
   621                     for px:= 0 to Pred(s^.w) do
   614                     for px:= 0 to Pred(s^.w) do
   622                         begin
   615                         if (Land[yy + py, xx + px] and $FF00) = 0 then
       
   616                             begin
   623                             if (cReducedQuality and rqBlurryLand) = 0 then
   617                             if (cReducedQuality and rqBlurryLand) = 0 then
   624                                 begin
   618                                 LandPixels[yy + py, xx + px]:= p^[px]
   625                                 if LandPixels[yy + py, xx + py] = 0 then
       
   626                                     LandPixels[yy + py, xx + px]:= p^[px];
       
   627                                 end
       
   628                             else
   619                             else
   629                                 if LandPixels[(yy + py) div 2, (xx + px) div 2] = 0 then
   620                                 LandPixels[(yy + py) div 2, (xx + px) div 2]:= p^[px]
   630                                     LandPixels[(yy + py) div 2, (xx + px) div 2]:= p^[px];
   621                             end;
   631 
       
   632                         end;
       
   633                     p:= @(p^[s^.pitch shr 2])
   622                     p:= @(p^[s^.pitch shr 2])
   634                     end;
   623                     end;
   635                 UpdateLandTexture(xx, 4, yy, 4)
   624                 UpdateLandTexture(xx, 4, yy, 4)
   636                 end
   625                 end;
       
   626             inc(yy,4);
       
   627             inc(xx,i);
       
   628             if ((xx and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx]:= Land[yy, xx] or lfBasic;
       
   629             if yy > 0 then
       
   630                 begin 
       
   631                 Land[yy-1, xx]:= Land[yy-1, xx] or lfBasic;
       
   632                 if ((xx-i and LAND_WIDTH_MASK) = 0) then Land[yy-1, xx-i]:= Land[yy-1, xx-i] or lfBasic;
       
   633                 end;
       
   634             if ((xx-i and LAND_WIDTH_MASK) = 0) and ((yy and LAND_HEIGHT_MASK) = 0) then Land[yy, xx-i]:= Land[yy, xx-i] or lfBasic
   637 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   635 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   638             end;
   636             end;
   639         if move then
   637         if move then
   640             begin
   638             begin
   641             X:= int2hwFloat(GetRandom(LAND_WIDTH+1024)-512);
   639             X:= int2hwFloat(GetRandom(LAND_WIDTH+1024)-512);