Loading content from zip archives

Originally posted to Shawn Hargreaves Blog on MSDN, Wednesday, June 6, 2007

Nick Gravelyn has posted some code for embedding XNA content in zip archives. Not only does this provide compression for your asset data, but it also reduces clutter, replacing many .xnb files with a single .zip.

He uses a custom MSBuild task (in a similar vein to what I described in my previous post) to create the archive as part of the regular build process, and then derives a new runtime class from ContentManager, overriding the OpenStream method to implement the decompression.

Very cool!

Blog index   -   Back to my homepage