hedgewars/uLand.pas
changeset 5231 29a3a9309f2c
parent 5227 17cf34724b57
child 5238 46ddaf14509d
equal deleted inserted replaced
5230:c088be28d5e8 5231:29a3a9309f2c
  1061     SDL_FreeSurface(tmpsurf);
  1061     SDL_FreeSurface(tmpsurf);
  1062     if (cReducedQuality and rqBlurryLand) = 0 then
  1062     if (cReducedQuality and rqBlurryLand) = 0 then
  1063         for x:= leftX+2 to rightX-2 do
  1063         for x:= leftX+2 to rightX-2 do
  1064             for y:= topY+2 to LAND_HEIGHT-3 do
  1064             for y:= topY+2 to LAND_HEIGHT-3 do
  1065                 if (Land[y, x] = 0) and 
  1065                 if (Land[y, x] = 0) and 
  1066                    (((Land[y, x-1] <> 0) and ((Land[y+1,x]<>0)) or (Land[y-1,x]<>0)) or
  1066                    (((Land[y, x-1] = lfBasic) and ((Land[y+1,x] = lfBasic)) or (Land[y-1,x] = lfBasic)) or
  1067                    ((Land[y, x+1] <> 0) and ((Land[y-1,x]<>0) or (Land[y+1,x]<>0)))) then
  1067                    ((Land[y, x+1] = lfBasic) and ((Land[y-1,x] = lfBasic) or (Land[y+1,x] = lfBasic)))) then
  1068                 begin
  1068                 begin
  1069                     if Land[y, x-1] <> 0 then LandPixels[y, x]:= LandPixels[y, x-1]
  1069                     if Land[y, x-1] = lfBasic then LandPixels[y, x]:= LandPixels[y, x-1]
  1070                     else if Land[y, x+1] <> 0 then LandPixels[y, x]:= LandPixels[y, x+1];
  1070                     else if Land[y, x+1] = lfBasic then LandPixels[y, x]:= LandPixels[y, x+1];
  1071                     LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (128 shl AShift)
  1071                     LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (128 shl AShift);
       
  1072                     Land[y,x]:= lfObject
  1072                 end
  1073                 end
  1073                 else if (Land[y, x] = 0) and
  1074                 else if (Land[y, x] = 0) and
  1074                         (((Land[y, x-1] <> 0) and (Land[y+1,x-1]<>0) and (Land[y+2,x]<>0)) or
  1075                         (((Land[y, x-1] = lfBasic) and (Land[y+1,x-1] = lfBasic) and (Land[y+2,x] = lfBasic)) or
  1075                         ((Land[y, x-1] <> 0) and (Land[y-1,x-1]<>0) and (Land[y-2,x]<>0)) or
  1076                         ((Land[y, x-1] = lfBasic) and (Land[y-1,x-1] = lfBasic) and (Land[y-2,x] = lfBasic)) or
  1076                         ((Land[y, x+1] <> 0) and (Land[y+1,x+1]<>0) and (Land[y+2,x]<>0)) or
  1077                         ((Land[y, x+1] = lfBasic) and (Land[y+1,x+1] = lfBasic) and (Land[y+2,x] = lfBasic)) or
  1077                         ((Land[y, x+1] <> 0) and (Land[y-1,x+1]<>0) and (Land[y-2,x]<>0)) or
  1078                         ((Land[y, x+1] = lfBasic) and (Land[y-1,x+1] = lfBasic) and (Land[y-2,x] = lfBasic)) or
  1078                         ((Land[y+1, x] <> 0) and (Land[y+1,x+1]<>0) and (Land[y,x+2]<>0)) or
  1079                         ((Land[y+1, x] = lfBasic) and (Land[y+1,x+1] = lfBasic) and (Land[y,x+2] = lfBasic)) or
  1079                         ((Land[y-1, x] <> 0) and (Land[y-1,x+1]<>0) and (Land[y,x+2]<>0)) or
  1080                         ((Land[y-1, x] = lfBasic) and (Land[y-1,x+1] = lfBasic) and (Land[y,x+2] = lfBasic)) or
  1080                         ((Land[y+1, x] <> 0) and (Land[y+1,x-1]<>0) and (Land[y,x-2]<>0)) or
  1081                         ((Land[y+1, x] = lfBasic) and (Land[y+1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic)) or
  1081                         ((Land[y-1, x] <> 0) and (Land[y-1,x-1]<>0) and (Land[y,x-2]<>0))) then
  1082                         ((Land[y-1, x] = lfBasic) and (Land[y-1,x-1] = lfBasic) and (Land[y,x-2] = lfBasic))) then
  1082                 begin
  1083                 begin
  1083                     if Land[y, x-1] <> 0 then LandPixels[y, x]:= LandPixels[y, x-1]
  1084                     if Land[y, x-1] = lfBasic then LandPixels[y, x]:= LandPixels[y, x-1]
  1084                     else if Land[y, x+1] <> 0 then LandPixels[y, x]:= LandPixels[y, x+1]
  1085                     else if Land[y, x+1] = lfBasic then LandPixels[y, x]:= LandPixels[y, x+1]
  1085                     else if Land[y+1, x] <> 0 then LandPixels[y, x]:= LandPixels[y+1, x]
  1086                     else if Land[y+1, x] = lfBasic then LandPixels[y, x]:= LandPixels[y+1, x]
  1086                     else if Land[y-1, x] <> 0 then LandPixels[y, x]:= LandPixels[y-1, x];
  1087                     else if Land[y-1, x] = lfBasic then LandPixels[y, x]:= LandPixels[y-1, x];
  1087                     LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (64 shl AShift)
  1088                     LandPixels[y,x]:= (LandPixels[y,x] and not AMask) or (64 shl AShift);
       
  1089                     Land[y,x]:= lfObject
  1088                 end;
  1090                 end;
  1089     AddProgress();
  1091     AddProgress();
  1090 end;
  1092 end;
  1091 
  1093 
  1092 procedure MakeFortsMap;
  1094 procedure MakeFortsMap;