anchor.diff:      finally
         Png.Free;
       end;
  +    {$ENDIF}
  +
  +    {$IFDEF FPC}
  +    po := TBGRABitmap.Create(aWidth, aHeight, BGRABlack);
  +    try
  +      for I := 0 to aHeight - 1 do
  +      for K := 0 to aWidth - 1 do
  +      begin
  +        T := (PCardinal(Cardinal(@Data[0]) + (I * aWidth + K) * 4))^;
  +        //I can't figure out how to get transparency to save in PNGs, so for now everything is opaque
  +        po.CanvasBGRA.Pixels[K,I] := T and $FFFFFF;
  +        po.AlphaPixel(K,I,255);
  +      end;
  +
  +      po.SaveToFile(Folder + aFilename + '.png');
  +    finally
  +      po.Free;
  +    end;
  +    {$ENDIF}
     end;
   end;
   
  
positive.code:     if InRange(I, 0, SizeY-1) and InRange(K, 0, SizeX-1) then
        Png.Pixels[K,I] := $FF00FF;//}
  
      Png.SaveToFile(aFolder + Format('%d_%.4d.png', [Byte(fRT)+1, ID]));
  
      //Export Flag values
      if fRXData.HasMask[ID] then
      begin
        for I := 0 to SizeY - 1 do
        for K := 0 to SizeX - 1 do
          Png.Pixels[K,I] := fRXData.Mask[ID, I*SizeX + K] * 65793;
  
        Png.SaveToFile(aFolder + Format('%d_%.4da.png', [Byte(fRT)+1, ID]));
      end;
    end;
  
    Png.Free;
  end;
  
  
  
negative.code:   KM_CommonTypes, KM_Defaults, KM_Pics, KM_Render, KM_TextLibrary
    {$IFDEF FPC}, zstream {$ENDIF}
    {$IFDEF WDC}, ZLib {$ENDIF}
    {$IFDEF FPC}, BGRABitmap, BGRABitmapTypes {$ENDIF};
  
  type
    TRXUsage = (ruMenu, ruGame); //Where sprites are used
  