hedgewars/uTextures.pas
changeset 10078 8572d1f8b2f0
parent 10040 4ac87acbaed9
child 10108 c68cf030eded
equal deleted inserted replaced
10077:ca67740f19b2 10078:8572d1f8b2f0
   144             if cpi <> lpi then
   144             if cpi <> lpi then
   145                 begin
   145                 begin
   146                 // invisible pixels get colors from visible neighbors
   146                 // invisible pixels get colors from visible neighbors
   147                 if cpi then
   147                 if cpi then
   148                     begin
   148                     begin
   149                     row1^[i]:= row1^[i-1] and not AMask;
   149                     row1^[i]:= row1^[i-1] and (not AMask);
   150                     // as this pixel is invisible and already colored correctly now, no point in further comparing it
   150                     // as this pixel is invisible and already colored correctly now, no point in further comparing it
   151                     lpi:= cpi;
   151                     lpi:= cpi;
   152                     continue;
   152                     continue;
   153                     end
   153                     end
   154                 else
   154                 else
   155                     row1^[i-1]:= row1^[i] and not AMask;
   155                     row1^[i-1]:= row1^[i] and (not AMask);
   156                 end;
   156                 end;
   157             end;
   157             end;
   158         lpi:= cpi;
   158         lpi:= cpi;
   159         // also check bottom neighbor
   159         // also check bottom neighbor
   160         if row2 <> nil then
   160         if row2 <> nil then
   161             begin
   161             begin
   162             bpi:= ((row2^[i+ioffset] and AMask) = 0);
   162             bpi:= ((row2^[i+ioffset] and AMask) = 0);
   163             if cpi <> bpi then
   163             if cpi <> bpi then
   164                 begin
   164                 begin
   165                 if cpi then
   165                 if cpi then
   166                     row1^[i]:= row2^[i+ioffset] and not AMask
   166                     row1^[i]:= row2^[i+ioffset] and (not AMask)
   167                 else
   167                 else
   168                     row2^[i+ioffset]:= row1^[i] and not AMask;
   168                     row2^[i+ioffset]:= row1^[i] and (not AMask);
   169                 end;
   169                 end;
   170             end;
   170             end;
   171         end;
   171         end;
   172 end;
   172 end;
   173 
   173