Hello Everyone,
I probably will not use this many animations for a long time but I was just testing , to see how much memory does it takes. And I'm a bit dissapointed , my program eats 50-60MB of memory if I use a resource file (ail) with 4x 2048x2048x16 PNG files ( the ail file itself is only 112K compressed with devilPNG, tried uncompressed as well no difference with memory usage... the file size changes to 16-20MB)
I load the ail file like this :
Code:
OnCreate
procedure TForm1.FormCreate(Sender: TObject);
begin
AdPerCounter := TAdPerformanceCounter.Create;
AdDraw := TAdDraw.Create(self);
AdDraw.DllName := 'AndorraDX93D.dll';
if AdDraw.Initialize then
begin
Application.OnIdle := Idle;
AdImageList := TAdImageList.Create(AdDraw);
AdImageList.LoadFromFile('BackGround.ail');
//create the SpriteEngine
AdSpriteEngine := TSpriteEngine.Create(nil);
AdSpriteEngine.Surface := AdDraw;
procedure TForm1.FormDestroy(Sender: TObject);
begin
AdSpriteEngine.Free;
AdImageList.Free;
AdPerCounter.Free;
AdDraw.Free;
end;
Can someone explain to me how do you calculate how much memory does a PNG file takes up when you load it into memory? Is there a "magic" way to decrease my mem usage with so many PNG files or I'm forced to use a lot smaller images ... I've only used this large images because I created quiet a large animation... just got into pixelart and can't stop, wanted to create a menu that goes Bling... for fun...and learn in the process...
Thank you
Rob
Bookmarks