anchor.diff:    if fChild2 <> nil then fChild2.Free;
   
     inherited;
  +end;
  +
  +
  +function TBin.CanFit(aItem: TIndexItem): Boolean;
  +begin
  +  Result := (aItem.X * aItem.Y < fNotFit);
  +end;
  +
  +
  +procedure TBin.DidNotFit(aItem: TIndexItem);
  +begin
  +  fNotFit := Min(fNotFit, aItem.X * aItem.Y);
   end;
   
   
  
positive.code:   I, K: Integer;
    BinManager: TBinManager;
  begin
    //Stub method - fit each sprite into own POT texture
    {SetLength(aOut, Length(aItems));
    for I := 0 to High(aItems) do
    begin
      aOut[I].Width := MakePOT(aItems[I].X + aPad * 2);
      aOut[I].Height := MakePOT(aItems[I].Y + aPad * 2);
  
      SetLength(aOut[I].Sprites, 1);
  
      aOut[I].Sprites[0].SpriteID := aItems[I].ID;
      aOut[I].Sprites[0].PosX := aPad;
      aOut[I].Sprites[0].PosY := aPad;
    end;}
  
    Assert(MakePOT(aMaxSize) = aMaxSize);
  
    //Sort Items by size to improve packing efficiency
  
negative.code:     function Width: Word;
      function Height: Word;
      procedure GetAllItems(var aItems: TBinItem);
  
      procedure DidNotFit(aItem: TIndexItem);
      function CanFit(aItem: TIndexItem): Boolean;
    end;
  
    TBinManager = class
  