hedgewars/uGearsUtils.pas
changeset 7525 5c840e221993
parent 7509 76e3a3fc17cd
child 7592 cf67e58313ea
equal deleted inserted replaced
7507:3032a5739fe1 7525:5c840e221993
   508 function CountNonZeroz(x, y, r, c: LongInt; mask: LongWord): LongInt;
   508 function CountNonZeroz(x, y, r, c: LongInt; mask: LongWord): LongInt;
   509 var i: LongInt;
   509 var i: LongInt;
   510     count: LongInt = 0;
   510     count: LongInt = 0;
   511 begin
   511 begin
   512     if (y and LAND_HEIGHT_MASK) = 0 then
   512     if (y and LAND_HEIGHT_MASK) = 0 then
   513         for i:= min(x + r, LAND_WIDTH - 4) downto max(x - r, 0) do 
   513         for i:= max(x - r, 0) to min(x + r, LAND_WIDTH - 4) do
   514             if Land[y, i] and mask <> 0 then
   514             if Land[y, i] and mask <> 0 then
   515             begin
   515             begin
   516                 inc(count);
   516                 inc(count);
   517                 if count = c then
   517                 if count = c then
   518                 begin
   518                 begin