Page 5 of 5 FirstFirst ... 345
Results 41 to 47 of 47

Thread: Pak Files?

  1. #41

    Pak Files?

    Ok, sorry I havn't posted an update, but I have infact built a very cool packaging system and now have a great understanding about file streams. I appreciate all the help.

    Now for a quicky, Does anyone know of a free, easy to use compression delphi code or component? I would like to implement compression into my packaging now. THanks
    I have a 2005 CRF 250 so <^>(>&lt<^>
    <br />http://www.gtrpg.com/

  2. #42

    Pak Files?

    There's a zlib.pas on the Delphi CD
    Ask me about the xcess game development kit

  3. #43

    Pak Files?

    And a link to show how to use it.
    http://www.swissdelphicenter.ch/torr...de.php?id=1617

    [edit this was the one I thought I was linking to at first, just show that there are many good thing over at torry.net]
    http://www.swissdelphicenter.ch/torr...ode.php?id=822
    Signature:
    <br />This is a block of text that can be added to posts you make. There is a 255 character limit

  4. #44
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Pak Files?

    (I just wish the things at Torry.net were easier to find...)

    I use ZipMaster etc:
    http://www.geocities.com/rjpeters_au/zipmaster.html

    Still being maintained which is nice - can also zip and unzip from a stream so no footprint on the harddisk.

    However does require DLLs to be installed.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  5. #45

    Pak Files?

    Well, my packer works great... But I tried moving some of the techniques I learned over to making a complete GUI config file that would load/save in a type... Problem is, it will save the type... then i can load it fine. But if i close the app out, get back in and try and load the type it wont load... But if i save something else, then i can go back and load the type just fine... I have no idea what's going on, maybe one of you can take a look:

    http://www.gtrpg.com/downloads/GUIConf.rar
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  6. #46
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Pak Files?

    I'm currently using something similar for load and save but I store each field to the stream. I'm using this to enable the encryption of user information and some config information using my CryptoUnit I published under tutorials.

    [pascal]
    TFavorite = Record
    User : TName;
    Name : TName;
    FileName : TFileName;
    End;
    TFavorites = Class(TObject)
    Private
    FavoritesList : TList;
    ...
    Public
    Procedure Load;
    Procedure Save;
    ...
    End;

    procedure TFavorites.Load;
    Var
    I : Integer;
    Fav : TFavorite;
    Mem : TMemoryStream;
    begin
    // Load all Favorites into list
    If Not FileExists(FileName) then
    Exit; // Blank Favorites file - will save on close
    Crypto.Password := 'Favorites for '+Application.Title;
    Mem := TMemoryStream.Create;
    Mem := TMemoryStream.Create;
    Crypto.Decrypt(Mem,FileName);
    Mem.Seek(0,soFromBeginning);
    While Mem.Position < Mem.Size do
    Begin
    Mem.Read(Fav.User,SizeOf(TName));
    Mem.Read(Fav.Name,SizeOf(TName));
    Mem.Read(Fav.FileName,SizeOf(TFileName));
    FavoritesList.Add(@Fav);
    End;
    Mem.Free;

    UserName := UserName; // Initialize Current User List
    end;

    procedure TFavorites.Save;
    Var
    I : Integer;
    Fav : TFavorite;
    Mem : TMemoryStream;
    begin
    Crypto.Password := 'Favorites for '+Application.Title;
    Mem := TMemoryStream.Create;
    For I := 0 to FavoritesList.Count - 1 do
    Begin
    Fav := TFavorite(FavoritesList[I]^);
    Mem.Write(Fav.User,SizeOf(TName));
    Mem.Write(Fav.Name,SizeOf(TName));
    Mem.Write(Fav.FileName,SizeOf(TFileName));
    End;
    Crypto.Encrypt(Mem,FileName);
    Mem.Free;
    end;

    [/pascal]

    Hope that helps.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  7. #47

    Pak Files?

    You try to take the name from the save dialog when both saving and loading. On the side note, you should really name you're components, when you're program gets big it's much nicer to see names like SaveButton rather than Button1. And you should really read the Object Pascal Style Guide http://community.borland.com/soapbox...5,10280,00.htm

Page 5 of 5 FirstFirst ... 345

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
  •