Jump to content
  • Advertisement


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


Loading Resources from a PAK File

This topic is 5899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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...

code, pics, life

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!