hedgewars/uLandGraphics.pas
changeset 10374 c7ef47665410
parent 10368 7ebb71a36e95
child 10378 c2b976d6c4f1
equal deleted inserted replaced
10373:5e83d029e918 10374:c7ef47665410
   661         for x:= 0 to Pred(w) do
   661         for x:= 0 to Pred(w) do
   662             if ((PLongword(@(p^[x * 4]))^) and AMask) <> 0 then
   662             if ((PLongword(@(p^[x * 4]))^) and AMask) <> 0 then
   663                 if (outOfMap and 
   663                 if (outOfMap and 
   664                    ((cpY + y) < LAND_HEIGHT) and ((cpY + y) >= 0) and
   664                    ((cpY + y) < LAND_HEIGHT) and ((cpY + y) >= 0) and
   665                    ((cpX + x) < LAND_WIDTH) and ((cpX + x) >= 0) and
   665                    ((cpX + x) < LAND_WIDTH) and ((cpX + x) >= 0) and
   666                    ((not force) or (Land[cpY + y, cpX + x] <> 0))) or
   666                    ((not force) and (Land[cpY + y, cpX + x] <> 0))) or
   667 
   667 
   668                    (not outOfMap and
   668                    (not outOfMap and
   669                        (((cpY + y) <= Longint(topY)) or ((cpY + y) >= LAND_HEIGHT) or
   669                        (((cpY + y) <= Longint(topY)) or ((cpY + y) >= LAND_HEIGHT) or
   670                        ((cpX + x) <= Longint(leftX)) or ((cpX + x) >= Longint(rightX)) or 
   670                        ((cpX + x) <= Longint(leftX)) or ((cpX + x) >= Longint(rightX)) or 
   671                        ((not force) or (Land[cpY + y, cpX + x] <> 0)))) then
   671                        ((not force) and (Land[cpY + y, cpX + x] <> 0)))) then
   672                    begin
   672                    begin
   673                    if SDL_MustLock(Image) then
   673                    if SDL_MustLock(Image) then
   674                        SDL_UnlockSurface(Image);
   674                        SDL_UnlockSurface(Image);
   675                    exit
   675                    exit
   676                    end;
   676                    end;