hedgewars/uLandGraphics.pas
changeset 10023 fa9674c94c4f
parent 9998 736015b847e3
child 10040 4ac87acbaed9
equal deleted inserted replaced
10022:eb981a03de90 10023:fa9674c94c4f
   677 end;
   677 end;
   678 
   678 
   679 function Despeckle(X, Y: LongInt): boolean;
   679 function Despeckle(X, Y: LongInt): boolean;
   680 var nx, ny, i, j, c, xx, yy: LongInt;
   680 var nx, ny, i, j, c, xx, yy: LongInt;
   681     pixelsweep: boolean;
   681     pixelsweep: boolean;
       
   682 
   682 begin
   683 begin
   683     Despeckle:= true;
   684     Despeckle:= true;
   684 
   685 
   685     if (cReducedQuality and rqBlurryLand) = 0 then
   686     if (cReducedQuality and rqBlurryLand) = 0 then
   686     begin
   687     begin
   707                     begin
   708                     begin
   708                         if pixelsweep then
   709                         if pixelsweep then
   709                         begin
   710                         begin
   710                             if ((cReducedQuality and rqBlurryLand) <> 0) then
   711                             if ((cReducedQuality and rqBlurryLand) <> 0) then
   711                             begin
   712                             begin
   712                                 nx:= nx div 2;
   713                                 ny:= Y div 2 + i;
   713                                 ny:= ny div 2
   714                                 nx:= X div 2 + j;
   714                             end;
   715                                 if ((ny and (LAND_HEIGHT_MASK div 2)) = 0) and ((nx and (LAND_WIDTH_MASK div 2)) = 0) then
   715                             if LandPixels[ny, nx] <> 0 then
   716                                     if LandPixels[ny, nx] <> 0 then
   716                                 inc(c);
   717                                         inc(c);
       
   718                             end
       
   719                             else if LandPixels[ny, nx] <> 0 then
       
   720                                     inc(c);
   717                         end
   721                         end
   718                     else if Land[ny, nx] > 255 then
   722                     else if Land[ny, nx] > 255 then
   719                         inc(c);
   723                         inc(c);
   720                     end
   724                     end
   721                 end;
   725                 end;