Archived

This topic is now archived and is closed to further replies.

spud

Loading Resources from a PAK File

Recommended Posts

Or a zip file, whatever. I''ve been looking for a library to help automate this process for me, but I''m not finding what I''m looking for. Just a simple library to extract files from a zip file, that doesn''t need another dll in the directory.

Share this post


Link to post
Share on other sites
have you tried using zlib (zlib.lib). It can both read and write zip files and compressed buffers.

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
This is the cunning way I retrofitted this.

I had a lot of modules to my engine that loaded things when passed a filename - models, textures, etc.

I wanted a pak file to encompass all my resources but I didn''t really want to go changing all my code.

So, I wrote a wrapper for zlib that would inflate a zip file containing all the game resources to a subdirectory and then SetCurrentDirectory to the new directory.

All the resource loading code would now find everything in the default directory as it expected without having to change any code )

At application exit, the subdirectory is deleted.

Hope this gives you some ideas...



www.coldcity.com
code, pics, life

Share this post


Link to post
Share on other sites