Archived

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

guylst

Working example of File Packing?

Recommended Posts

I found much info of resource file packing(like bmp, wav) within this site but failed to find any working examples for it. Can anyone post any examples or links here? Any help will be greatly appreciated.

Share this post


Link to post
Share on other sites
Packing as in just lumping the files together? It can cause some problems if your functions require individual files to correctly load a resource.... but as long as you can get it to read from an open file (one where your own code has located the correct sub-file) it should all work.....

Yes/No/Maybe?

I''ll post my file packing code here if you want....

If you are very desperate, get a zlib library and use zip files

Share this post


Link to post
Share on other sites
quote:
Original post by Cirian

If you are very desperate, get a zlib library and use zip files


I thought the point of packing your images was so people couldn''t edit them.

Whats the point of putting them in a .zip, when they can be decompressed by even the most computer-illiterate people?

Share this post


Link to post
Share on other sites
Thank you all of you guys, but my problem actually is not on packing the files into a single file. I succeeded to pack the files into a single mpk file. However, I failed to load the files from that single ''resource file''.
More specifically, I failed to loading them onto DirectDraw Surface.

Jackthemeangiant, it''s so great that you can provide a tutorial about my problem, so where does it post?

Cirian, besides packing code, do you got ''loading'' code for DD Surface?

Drizzt DoUrden, I agree with you because I just dont like to see my arts or other stuffs so easily to be tampered or adopted by the user.

Thanks again

Share this post


Link to post
Share on other sites
Here ya go,

I made a DOS program called builder to create the file, and the loader program uses OpenGL using Nehe's base code. You can just look at the first function in the file, it loads all the textures.

Link



Edited by - jackthemeangiant on December 12, 2001 11:51:38 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
guylst: Glad you fixed your problem.

Drizzt: Either replace "PK" with something else (first 2 bytes) or name them "*.bob" or something.

I appreciate your argument however... which is why I use my own format for everything except sound, including my pack files....

Share this post


Link to post
Share on other sites
quote:
Original post by Drizzt DoUrden
I thought the point of packing your images was so people couldn''t edit them.

Whats the point of putting them in a .zip, when they can be decompressed by even the most computer-illiterate people?

To make them smaller? Both in terms of the actual compression, and in terms of saving space compared to having lots of smaller files.

Thief: The Dark Project uses ZIP files, but calls them CRF.


[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Share this post


Link to post
Share on other sites