Sign in to follow this  
Azzazelus_13

One resource file.

Recommended Posts

I was wondering how to stick multiple resource files into one single file and then load them whith Dx functions like LoadImage/X file etc.. Those functions take parameters as paths to the file but I need somehow to load "chunks" but I dont know how. Thanks..

Share this post


Link to post
Share on other sites
Well, should I pack all files with zlib and then load them in the memory?
Or pack every single file with zlib, add all packed files to a single .pak (not zlib, just a file that contains all of them) and then load a chunk and unzip , load and unzip etc..?

Im intersted in faster loading. Not protecting my files or anything..

[Edited by - Azzazelus_13 on February 1, 2008 7:21:48 PM]

Share this post


Link to post
Share on other sites
Broadly speaking, the limiting factor for file loading is the disk access, so what would be fastest depends on minimizing the frequency and volume that you access the disk. This in turn means that the optimal compression method is dependent on your usage pattern as well as the compressibility of your individual files. If you frequently load a single highly compressible file from your archive then storing a package of individually compressed files could perform better. If you do loads in batches where you pull everything in a package at once and most of your files don't compress well, then a compressed archive would probably be fastest.

Personally, I generally just dump everything into a normal zip file and use PhysFS to read it. It's usually fast enough for what I want to do and requires very little programming effort on my part.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this