Sign in to follow this  
hziee

how to pack/read game recourse?

Recommended Posts

in my idear, write recourses one by one into a pack by a regulation when reads recourses, some API'parameter nees filename(assume we have no way to change),how to solve it? any other good ways? hope to share your experience.thanks

Share this post


Link to post
Share on other sites
theres a guide on here about doing something simple like a PAK file, were you generate a header everytime you store a new file that contains info on the files name and were it starts in the pak file. then everything is read in by binary and then appened one by one to the pak file.

Share this post


Link to post
Share on other sites
1. Use zziplib, physFS or another VFS library.
2. Don't use API's, who only accept file names - only use API's, who accept data streams.

If you state your current API's, I'm sure we can find alternatives to them.

Share this post


Link to post
Share on other sites
Quote:
Original post by nife87
1. Use zziplib, physFS or another VFS library.
2. Don't use API's, who only accept file names - only use API's, who accept data streams.

If you state your current API's, I'm sure we can find alternatives to them.


Meaning according to you,if use packed data, the program's interface must can accept date streams. -That's right?

another question: The date must be compressed? If the date is compressed,when read the pack, firstly read the compressed data,then uncompressed it,finally,send the date to the interface - That's right?

Share this post


Link to post
Share on other sites
Well if you want to create a way to write your own custom packed resource file, you could give this tutorial a try Custom Resource Files.

Even though it doesnt teach you how to compress the pack file, it does explain how to put it together, and it is clear enough for you to know how to include a compression API into your code... Using Zlib would be a good idea for compression as you can use it whilst you create a pack file and when you read it.

Share this post


Link to post
Share on other sites
I meet a problem: when using DxShow lib,the API IGraphBuilder::RenderFile( LPCWSTR lpcwstrFile, LPCWSTR lpcwstrPlayList),And i cann't find any other way to replace. So I cann't add the media files to the PackFile.
May be that's another problem, but its my affliction. any advice? thx.

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