I did a bit of background research on the packaging / bundling issue, partly for my own curiosity, and in the vague hope of helping someone who wants to take a crack at this..

Essentially, anyone who's installed add-ons for MSFS (any version) knows what a pain it is, and uninstalling them is next to impossible. As people here have noted, the sane thing is to support (optionally!) reading files from a package. This is done by Fly! (.pod files), Doom, Quake, Mozilla, Crystal Space and indeed, Java.

The preceding list of software was not selected at random :-)

The last four all use .zip files (but renamed to pk3 in the case of Quake 3, and .jar in the case of Mozilla and Java) as the packaging format. Using a well known format makes many thing easier, as anyone who's found the limitations of Fly!'s POD editor will agree.

Now, I wondered why no one has used tar.gz, rather than .zip .... so I went and read the file format specs for .tar, and for .zip. Essentially, the tar format was designed around a write-once, stream orientated device (well, yeah, it's a Tape ARchvie). One of the things it's therefore lacking is a Table-of-Contents structure listing the archive contents. This makes accessing arbitrary individual files from the archives a bit of a pain; you either do a linear search each time, or build a TOC in memory (with offsets into the archive) at startup. This has issues of it's own, like further slowing down startup time :-)

So, it seems like ZIP might actually be the way to go ... extracting a single (say) 2k texture from a 300MB archive is doable without reading the entire archive. The next issue is stealing some code....

Mozilla has a libjar, which is rather large (it also handles the 'MANIFEST' files which are part of the Java JAR spec, and which provide lots of useful meta-data about the file contents, like the classes it contains ... we could use meta-data, certainly, but I think it's be easier to define a trivial XML syntax than use the JAR one).

However, CrystalSpace contains a single file, C++ implementation of a .ZIP reader, with a sane API. It's at:
crystal/CS/libs/csutil/archive.cpp


Obviously it would need a little adaption for FG, but it's pretty simple code (it even has comments), so if anyone is considering doing this, I'd strongly recommend it, rather than someone here having to grovel in the ZIP format manually, or to create a dependancy on some heavy-weight library.

Anyway, hope this is of some use.
James

--
There is no such thing as a humble opinion.


_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to