included zlib ?
2 posters
included zlib ?
is there a reason you use your own implementation of zlib and not use the included apple zlib?
the zlib you include in the engine obviously does archiving, does apples zlib not do the same?
the zlib you include in the engine obviously does archiving, does apples zlib not do the same?
drunknbass- Posts : 16
Join date : 2008-12-04
Re: included zlib ?
Yes, basically it is the same however I've done some minor modifications on the buffer in order to speed up the decompression.
Re: included zlib ?
oh I see. I was under the assumption that the built in apple zlib could not handle zips of multiple files. I guess I was wrong.
drunknbass- Posts : 16
Join date : 2008-12-04
Re: included zlib ?
reason i ask is because i had other resources i thought i could package in a zip and copy to documents and decompress to tmp when i run my game.
i was just having a hard time understanding how sio2 resources are unpacked.. any info to point me in the right direction would be great!
i was just having a hard time understanding how sio2 resources are unpacked.. any info to point me in the right direction would be great!
drunknbass- Posts : 16
Join date : 2008-12-04
Re: included zlib ?
Everything is done in memory... Nothing is touching the disk...
Basically what I do is this:
The zip file is open and I loop through all the files. For each file I extract the compressed stream, decompress in memory and send the uncompressed stream to the appropriate loader. Check the SIO2stream structure of SIO2 basically it operate like: fopen, fread, fseek etc... but its all done in memory...
Hope this help,
Cheers!
Basically what I do is this:
The zip file is open and I loop through all the files. For each file I extract the compressed stream, decompress in memory and send the uncompressed stream to the appropriate loader. Check the SIO2stream structure of SIO2 basically it operate like: fopen, fread, fseek etc... but its all done in memory...
Hope this help,
Cheers!
Re: included zlib ?
thx for the kickstart. I found some windows code online that uses the same unzip.c and h and I'm slowly working at it. So far it seems you open a zip and work through the files 1 by 1 almost like parsing nodes of XML. Also the code I found mallocs memory for the size of the uncompressed file. I wonder if there's a way to write from file to disk directly would putting it in memory first. Not sure but it might be required for the decompression. Working with limited memory usage on iPhone makes things so difficult.
drunknbass- Posts : 16
Join date : 2008-12-04
Permissions in this forum:
You cannot reply to topics in this forum
|
|