hedgewars/uGearsUtils.pas
changeset 11196 0f6916065849
parent 11046 47a8c19ecb60
child 11197 283b6e6cf7ea
equal deleted inserted replaced
11195:ba192ec1f201 11196:0f6916065849
   850     delta:= LAND_WIDTH div 16;
   850     delta:= LAND_WIDTH div 16;
   851     cnt2:= 0;
   851     cnt2:= 0;
   852     repeat
   852     repeat
   853         x:= Left + max(LAND_WIDTH div 2048, LongInt(GetRandom(Delta)));
   853         x:= Left + max(LAND_WIDTH div 2048, LongInt(GetRandom(Delta)));
   854         repeat
   854         repeat
   855             inc(x, Delta);
       
   856             cnt:= 0;
   855             cnt:= 0;
   857             y:= min(1024, topY) - Gear^.Radius shl 1;
   856             y:= min(1024, topY) - Gear^.Radius shl 1;
   858             while y < cWaterLine do
   857             while y < cWaterLine do
   859                 begin
   858                 begin
   860                 repeat
   859                 repeat
   900                     begin
   899                     begin
   901                     ar2[cnt2].x:= x;
   900                     ar2[cnt2].x:= x;
   902                     ar2[cnt2].y:= y;
   901                     ar2[cnt2].y:= y;
   903                     inc(cnt2)
   902                     inc(cnt2)
   904                     end
   903                     end
   905                 end
   904                 end;
   906         until (x + Delta > Right);
   905             inc(x, Delta)
       
   906         until (x > Right);
   907 
   907 
   908         dec(Delta, 60)
   908         dec(Delta, 60)
   909     until (cnt2 > 0) or (Delta < 70);
   909     until (cnt2 > 0) or (Delta < 70);
   910     // if either of these has not been tried, do another pass
   910     // if either of these has not been tried, do another pass
   911     if (cnt2 = 0) and skipProximity and (not ignoreOverlap) then
   911     if (cnt2 = 0) and skipProximity and (not ignoreOverlap) then