Loading content from zip archives

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!

Comments (2)

  1. nickgravelyn says:

    Wanted to comment that anyone looking for zipping up their content files should check out the newer version of my system found at this codeplex page: http://www.codeplex.com/xnaziplib

Skip to main content