anchor.diff:      fRT: TRXType;
       fRXData: TRXData;
   
  -    fGFXPrepData: array[TSpriteAtlasType] of  // for each atlas type
  +    fGFXPrepData: array [TSpriteAtlasType] of // for each atlas type
                       array of                  // Atlases
                         record                  // Atlas data, needed for Texture Atlas Generation
                           SpriteInfo: TBinItem;
  
positive.code: end;
  
  
  //Parse all valid files in Sprites folder and load them additionaly to or replacing original sprites
  procedure TKMSpritePack.OverloadFromFolder(const aFolder: string; aSoftenShadows: Boolean = True);
  
    procedure ProcessFolder(const aProcFolder: string; aRT: TRXType);
    {$IFDEF WDC}
    var
      I, ID: Integer;
      fileList, IDList: TStringList;
      searchRec: TSearchRec;
      filePath, relName, regex, s: string;
      Predicate: TDirectory.TFilterPredicate;
    {$ENDIF}
    begin
      {$IFDEF WDC}
      if not DirectoryExists(aProcFolder) then Exit;
  
      fileList := TStringList.Create;
      try
        IDList := TStringList.Create;
        try
          //PNGs
          regex := '^'+IntToStr(Byte(fRT)+1)+'_[0-9]+\.png$';
          Predicate :=
            function(const Path: string; const SearchRec: TSearchRec): Boolean
            begin
              Result := TRegEx.IsMatch(SearchRec.Name, regex);
            end;
  
          for filePath in TDirectory.GetFiles(aProcFolder, IntToStr(Byte(fRT)+1) + '_*.png', TSearchOption.soAllDirectories, Predicate) do
          begin
            relName := ExtractRelativePath(aProcFolder, filePath);
            // skip image, if subfolder contains 'skip' string
            if not relName.Contains('skip') then
              fileList.Add(relName);
          end;
  
          //PNG may be accompanied by some more files
          //#_####.png - Base texture
          //#_####a.png - Flag color mask
          //#_####.txt - Pivot info (optional)
          for I := fileList.Count - 1 downto 0 do
          begin
            s := ExtractFileName(fileList.Strings[I]);
            if TryStrToInt(Copy(s, 3, Length(s)-6), ID) then
            begin
              AddImage(aProcFolder, fileList.Strings[I], ID);
              IDList.Add(IntToStr(ID));
            end;
          end;
  
          if aSoftenShadows then
            SoftenShadows(IDList); // Soften shadows for overloaded sprites
  
          // Determine objects size only for units (used for hitbox)
          //todo: do we need it for houses too ?
          if aRT = rxUnits then
            DetermineImagesObjectSize(IDList);
  
          try
            //Delete following sprites
            if FindFirst(aProcFolder + IntToStr(Byte(fRT) + 1) + '_????', faAnyFile - faDirectory, searchRec) = 0 then
            repeat
              if TryStrToInt(Copy(searchRec.Name, 3, 4), ID) then
                fRXData.Flag[ID] := 0;
            until (FindNext(searchRec) <> 0);
          finally
            FindClose(searchRec);
          end;
        finally
          IDList.Free;
        end;
      finally
        fileList.Free;
      end;
      {$ENDIF}
    end;
  
  begin
    if SKIP_RENDER then Exit;
  
    ProcessFolder(aFolder, fRT);
    ProcessFolder(aFolder + IntToStr(Byte(fRT) + 1) + PathDelim, fRT);
  end;
  
  
  //Export RX to Bitmaps without need to have GraphicsEditor, also this way we preserve image indexes
  procedure TKMSpritePack.ExportAll(const aFolder: string);
  var
    I: Integer;
  
negative.code: end;
  
  
  procedure TKMSpritePack.DetermineImagesObjectSize(aIdList: TList<Integer>);
  var
    I, id: Integer;
    shadowConverter: TKMSoftShadowConverter;
  begin
    if aIdList.Count = 0 then Exit;
  
    shadowConverter := TKMSoftShadowConverter.Create(Self);
    try
      for I := 0 to aIdList.Count - 1 do
      begin
        id := aIdList[I];
        if fRXData.Flag[id] <> 0 then
          shadowConverter.DetermineImageObjectSize(id);
      end;
    finally
      shadowConverter.Free;
  