hedgewars/uGearsUtils.pas
changeset 7509 76e3a3fc17cd
parent 7492 3188794b9d87
child 7592 cf67e58313ea
equal deleted inserted replaced
7505:94e1fa117081 7509:76e3a3fc17cd
   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