1
\$\begingroup\$

I want to somehow "pack" (not compress) multiple game files into one bigger file. Something like Valve's .gcf, where reading from the application should be easy; like accessing an ordinary stored file.

I'm aiming for some kind of simple use, something like:

my_asset_file->setAssetFile(ASSET_FOLDER + '/file.ext');
Model *m = new Model();
m->loadFromTxtFile(my_asset_file->openTxtFile('models/props/lamp.obj'));
\$\endgroup\$
  • \$\begingroup\$ Why couldn't you use something like zlib? And why the requirement to not compress? \$\endgroup\$ – Tetrad Feb 22 '12 at 1:09
  • \$\begingroup\$ In many cases running a second compression on already compressed data will actually expand the storage used. But even so, zlib (and variants) as been used quite successfully for this purpose so now I'm curious as to nekome's reason =) \$\endgroup\$ – Patrick Hughes Feb 22 '12 at 1:46
  • \$\begingroup\$ I have done exactly that for my little game engine, I guess I could just share it with you if you wanted, even the whole engine.. \$\endgroup\$ – Grimshaw Feb 22 '12 at 2:01
  • \$\begingroup\$ Well, i wouldn't want to spend processing cycles for decompression while player plays, while engine loads some props. And I did thought about zlib or lzma but wasn't sure how easy would be to use it for this purpose. PhysicsFS seems to be made for this purpose but I'll check it out as well as these other two. Thanks; @DevilWithin thanks, but this PhysicsFS should do the trick. \$\endgroup\$ – edin-m Feb 22 '12 at 11:13
  • \$\begingroup\$ @DevilWithin Would you mind sharing it with the community then? I think it would be more than helpful to all of us. \$\endgroup\$ – Sin Jun 16 '13 at 16:57
7
\$\begingroup\$

PhysicsFS should be able to handle it.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.