Results 1 to 9 of 9

Thread: Andorra 2D latest, Delphi7, resource (ail) file with 4x 2048x2048x16 PNG

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Andorra 2D latest, Delphi7, resource (ail) file with 4x 2048x2048x16 PNG

    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
    Last edited by WILL; 01-08-2011 at 06:36 PM. Reason: Put your code into a code block...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •