anchor.diff:          L := Data[i, Pixel]; //0..255
   
           if L<>0 then
  -          if NeedTeamColors and (L in[23..29]) then
  -            RGBA[i,Pixel] := cardinal((byte(L-26)*42+128)*65793) OR $FF000000
  -          else
  +          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);
  -
  -        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;
      end;
     end;
  
positive.code:     setlength(TD,WidthPOT*HeightPOT+1);
      setlength(TA,WidthPOT*HeightPOT+1);
  
      for i:=1 to HeightPOT do begin
        ci:=0;
        for j:=LeftIndex to RightIndex do
          for k:=1 to RXData[RXid].Size[j].X do begin
            inc(ci);
            if i<=RXData[RXid].Size[j].Y then begin
              TD[(i-1)*WidthPOT+ci-1] := RXData[RXid].RGBA[j,(i-1)*RXData[RXid].Size[j].X+k-1];
              TA[(i-1)*WidthPOT+ci-1] := RXData[RXid].Mask[j,(i-1)*RXData[RXid].Size[j].X+k-1];
            end else begin
              //TD[(i-1)*WidthPOT+ci-1]:=0;
            end;
          end;
      end;
  
  
negative.code:   WidthPOT,HeightPOT:integer;
    TD:array of cardinal;
    TA:array of cardinal;
    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
  