Its a little better.

Published September 18, 2005
Advertisement
Looking back, it makes sence that the data blocks are compressed. I was able to get SharpZipLib to do exactly what I wanted, and in minimal code. Really just a function call to the inflater and deflater, check the return code for errors and all was good.

Extracting a file out of the archive is working great. I decided to move the decompression function into the class that reads and parses the file. I also added a place to store the datablock in the FileItem class. I think this will help when I finish the import routine, because I will need to rewrite the file, I will have to recalculate the offsets. Ok, so that does not really explain why.. but I will have the output routine in the class that has the ArrayList of FileItems, so it can write out the file index, and because the file uses an offset that starts at the end of the index I don't need to calculate it. It should go something like this, item.offset = sum_of_all_previous_items_lengths. The first index always has an offset of 0, this is handy.

Anyways, I'm not much of a writer so I'll just get on to coding today. I hope I can finish the importing this morning.

I came up with a funny question...
When dealing with compressed files that are being read off of a hard disk, is it faster (with modern processors) to read in 9,000 bytes and decompress it in to memory, or read in the uncompressed 900,000 bytes stright in to memory? I know that the HDD is the slowest deice in the system, but 900,000 bytes isn't alot. I do think it is faster to decompress the chunk in memory, but I want to write a feature for this program that will rearchive the file with lower compression, to see if I am wrong. To see if the game actually loads faster because of the reduced compression. Too bad I probally will not be able to actually measure the difference. I can't think of anything other than my wrist watch that will be able to time the length of the loading screens for the game.

Until next time.
Previous Entry Zoned out.
Next Entry Not bad.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Not bad.

1145 views

Zoned out.

1021 views

more

1100 views

Slow down champ.

917 views

I'll be back

879 views

Busy.

1036 views

oh teh noes!!

923 views
Advertisement