anchor.diff:    WidthPOT,HeightPOT:integer;
     TD:array of cardinal;
     TA:array of cardinal;
  -begin
  +  HasMask:array of boolean;
  +begin
  +
  +  setlength(HasMask, RXData[RXid].Qty+1);
  +  if MAKE_TEAM_COLORS and RXData[RXid].NeedTeamColors then //Otherwise Masks ignored 
  +  for i:=1 to RXData[RXid].Qty do begin
  +    k:=0;
  +    while (k<=(length(RXData[RXid].RGBA[i])-1)) and not HasMask[i] do begin
  +      HasMask[i] := RXData[RXid].RGBA[i,k]<>0;
  +      inc(k);
  +    end;
  +  end;
   
     LeftIndex:=0; AllocatedRAM:=0; RequiredRAM:=0; ColorsRAM:=0; TexCount:=0;
     repeat
  
positive.code:     begin
        GFXData[RXid,LeftIndex].TexID := GenTexture(WidthPOT,HeightPOT,@TD[0],tm_TexID);
        //TeamColors are done through alternative plain colored texture
        GFXData[RXid,LeftIndex].AltID := GenTexture(WidthPOT,HeightPOT,@TA[0],tm_AltID);
        inc(ColorsRAM,WidthPOT*HeightPOT*4);
      end
      else
        GFXData[RXid,LeftIndex].TexID := GenTexture(WidthPOT,HeightPOT,@TD[0],tm_TexID);
  
negative.code:         L := Data[i, Pixel]; //0..255
  
          if L<>0 then
            if NeedTeamColors and (L in[23..29]) then begin
              RGBA[i,Pixel] := cardinal(((L-26)*42+128)*65793) OR $FF000000;
              case L of //Maybe it makes sense to convert to 8bit?
                23,29:  Mask[i,Pixel] := $60FFFFFF;   //7  //6
                24,28:  Mask[i,Pixel] := $90FFFFFF;   //11 //9
                25,27:  Mask[i,Pixel] := $C0FFFFFF;   //14 //12
                26:     Mask[i,Pixel] := $FFFFFFFF;   //16 //16
              end;
            end else
              RGBA[i,Pixel] := GetColor32(L, Palette);
        end;
     end;
    end;
  