with Allegro.Displays; use Allegro.Displays;
private with Ada.Containers.Doubly_Linked_Lists;
limited private with Tiles.Atlases.Bins;
private package Tiles.Atlases is
type Atlas is new Limited_Object with private;
type A_Atlas is access all Atlas'Class;
function Create_Atlas( display : not null A_Allegro_Display;
pageWidth,
pageHeight : Positive ) return A_Atlas;
pragma Postcondition( Create_Atlas'Result /= null );
procedure Add_Bitmap( this : not null access Atlas'Class;
bmp : in out A_Allegro_Bitmap );
procedure Save_Bitmaps( this : not null access Atlas'Class;
name : String );
procedure Delete( this : in out A_Atlas );
private
type Page is
record
bmp : A_Allegro_Bitmap;
bin : access Tiles.Atlases.Bins.Bin'Class;
full : Boolean := False;
end record;
type A_Page is access all Page;
package Page_Lists is new Ada.Containers.Doubly_Linked_Lists( A_Page, "=" );
type Atlas is new Limited_Object with
record
display : A_Allegro_Display := null;
pageWidth,
pageHeight : Natural := 0;
pages : Page_Lists.List;
end record;
procedure Construct( this : in out Atlas;
display : not null A_Allegro_Display;
pageWidth,
pageHeight : Positive );
procedure Delete( this : in out Atlas );
procedure Add_Page( this : not null access Atlas'Class );
end Tiles.Atlases;