hedgewars/uLandGraphics.pas
branchwebgl
changeset 8841 338f7c2bac2c
parent 8839 caa57115d7ea
child 9127 e350500c4edb
equal deleted inserted replaced
8839:caa57115d7ea 8841:338f7c2bac2c
    92     end;
    92     end;
    93 end;
    93 end;
    94 
    94 
    95 function isLandscapeEdge(weight:Longint):boolean; inline;
    95 function isLandscapeEdge(weight:Longint):boolean; inline;
    96 begin
    96 begin
    97 result := (weight < 8) and (weight >= 2);
    97 isLandscapeEdge := (weight < 8) and (weight >= 2);
    98 end;
    98 end;
    99 
    99 
   100 function getPixelWeight(x, y:Longint): Longint;
   100 function getPixelWeight(x, y:Longint): Longint;
   101 var
   101 var
   102     i, j:Longint;
   102     i, j, r: Longint;
   103 begin
   103 begin
   104 result := 0;
   104 r := 0;
   105 for i := x - 1 to x + 1 do
   105 for i := x - 1 to x + 1 do
   106     for j := y - 1 to y + 1 do
   106     for j := y - 1 to y + 1 do
   107     begin
   107     begin
   108     if (i < 0) or
   108     if (i < 0) or
   109        (i > LAND_WIDTH - 1) or
   109        (i > LAND_WIDTH - 1) or
   110        (j < 0) or
   110        (j < 0) or
   111        (j > LAND_HEIGHT -1) then
   111        (j > LAND_HEIGHT -1) then
   112        begin
   112        exit(9);
   113        result := 9;
   113 
   114        exit;
       
   115        end;
       
   116     if Land[j, i] and lfLandMask and (not lfIce) = 0 then
   114     if Land[j, i] and lfLandMask and (not lfIce) = 0 then
   117        result := result + 1;
   115        inc(r)
   118     end;
   116     end;
       
   117 
       
   118     getPixelWeight:= r
   119 end;
   119 end;
   120 
   120 
   121 
   121 
   122 procedure fillPixelFromIceSprite(pixelX, pixelY:Longint); inline;
   122 procedure fillPixelFromIceSprite(pixelX, pixelY:Longint); inline;
   123 var
   123 var