anchor.diff:    {$IFDEF FPC}
     po: TBGRABitmap;
     {$ENDIF}
  +  FileNameA: string;
   begin
     Assert(SameText(ExtractFileExt(aFilename), '.png'));
   
     if aIndex >= fRXData.Count then
       Allocate(aIndex);
  -
  -  fRXData.HasMask[aIndex] := FileExists(aFolder + Copy(aFilename, 1, 6) + 'a.png');
   
     {$IFDEF WDC}
     po := TPNGObject.Create;
  
positive.code:     //Prepare atlases
      for I := 0 to High(SpriteInfo) do
      begin
        //todo: Assert that atlas dimensions are POT
        SetLength(TD, 0);
        SetLength(TD, SpriteInfo[I].Width * SpriteInfo[I].Height);
  
        //Copy sprite to Atlas
        //todo: Fill padding with edge color
        for K := 0 to High(SpriteInfo[I].Sprites) do
        begin
          ID := SpriteInfo[I].Sprites[K].SpriteID;
  
negative.code:     po.Free;
    end;
  
    FileNameA := StringReplace(aFilename, '.png', 'a.png', [rfReplaceAll, rfIgnoreCase]);
    fRXData.HasMask[aIndex] := FileExists(aFolder + FileNameA);
  
    //Load and process the mask if it exists
    if fRXData.HasMask[aIndex] then
    begin
      //PNG masks are designed for the artist, they take standard KaM reds so it's easier
      {$IFDEF WDC}
      po := TPNGObject.Create;
      po.LoadFromFile(aFolder + FileNameA);
      {$ENDIF}
      {$IFDEF FPC}
      po := TBGRABitmap.Create(aFolder + FileNameA);
      {$ENDIF}
  
      if (fRXData.Size[aIndex].X = po.Width) and (fRXData.Size[aIndex].Y = po.Height) then
      begin
        //We don't handle transparency in Masks
        {$IFDEF WDC}
        for y:=0 to po.Height-1 do for x:=0 to po.Width-1 do
        if cardinal(po.Pixels[x,y] AND $FF) <> 0 then
        begin
          T := fRXData.RGBA[aIndex, y*po.Width+x] AND $FF; //Take red component
          fRXData.Mask[aIndex, y*po.Width+x] := Byte(255-Abs(255-T*2));
          fRXData.RGBA[aIndex, y*po.Width+x] := T*65793 OR $FF000000;
        end;
        {$ENDIF}
        {$IFDEF FPC}
        for y:=0 to po.Height-1 do for x:=0 to po.Width-1 do
        if cardinal(po.GetPixel(x,y).red) <> 0 then
        begin
          T := fRXData.RGBA[aIndex, y*po.Width+x] AND $FF; //Take red component
          fRXData.Mask[aIndex, y*po.Width+x] := Byte(255-Abs(255-T*2));
          fRXData.RGBA[aIndex, y*po.Width+x] := T*65793 OR $FF000000;
        end;
        {$ENDIF}
      end;
      po.Free;
    end;
  
    //Read pivot info
  