anchor.diff:      //Prepare atlases
       for I := 0 to High(SpriteInfo) do
       begin
  -      //todo: Assert that atlas dimensions are POT
  +      Assert(MakePOT(SpriteInfo[I].Width) = SpriteInfo[I].Width);
  +      Assert(MakePOT(SpriteInfo[I].Height) = SpriteInfo[I].Height);
         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;
  
positive.code:   {$IFDEF FPC}
    po: TBGRABitmap;
    {$ENDIF}
  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;
  
negative.code:           if aMode = saBase then
              TD[Pixel] := fRXData.RGBA[ID, L * fRXData.Size[ID].X + M]
            else
              TD[Pixel] := $FFFFFF or (fRXData.Mask[ID, L * fRXData.Size[ID].X + M] shl 24);
  
            //Fill padding with edge pixels
            if fPad > 0 then
            begin
              if (M = 0) then
              begin
                TD[Pixel - 1] := TD[Pixel];
                if (L = 0) then
                  TD[Pixel - SpriteInfo[I].Width - 1] := TD[Pixel]
                else
                if (L = fRXData.Size[ID].Y - 1) then
                  TD[Pixel + SpriteInfo[I].Width - 1] := TD[Pixel];
              end;
  
              if (M = fRXData.Size[ID].X - 1) then
              begin
                TD[Pixel + 1] := TD[Pixel];
                if (L = 0) then
                  TD[Pixel - SpriteInfo[I].Width + 1] := TD[Pixel]
                else
                if (L = fRXData.Size[ID].Y - 1) then
                  TD[Pixel + SpriteInfo[I].Width + 1] := TD[Pixel];
              end;
  
              if (L = 0) then                       TD[Pixel - SpriteInfo[I].Width] := TD[Pixel];
              if (L = fRXData.Size[ID].Y - 1) then  TD[Pixel + SpriteInfo[I].Width] := TD[Pixel];
            end;
  
            //Sprite outline
            if OUTLINE_ALL_SPRITES and (
  