Page 1 of 1

Compressed XML

Posted: Fri Oct 28, 2005 05:57
by Wibble
XML files have a tendency to get quite bulky and large. It would great if they could zipped and read from zip files.

Re: Compressed XML

Posted: Fri Oct 28, 2005 07:22
by scriptkid
Hi,

"large" is pretty relative these days. Compared to other resources of a game, the size of the gui files is very small i think.

Besides, distributable packages of a game are often zipped or packed with an installer anyways.

Don't you agree?

Re: Compressed XML

Posted: Fri Oct 28, 2005 08:40
by gcarlton
This is already possible using the ResourceProvider class. In fact, its one of the easier things to hook up.

Subclass DefaultResourceProvider, and in loadRawDataContainer, read the entry from the zip files and pass the raw byte data back to cegui. Then in unloadRawDataContainer, just free up the byte data (or return it to a pool, or whatever).

This allows the app side of things to do pretty much anything they want in regards to file handling. :pint:

Re: Compressed XML

Posted: Fri Oct 28, 2005 18:46
by Wibble
Thanks for the tips on how to implement a new resource provider. I'll have a look at this at some point.

WRT to resource sizes. Yes, the installer may compress resources for you, but why take up extra disc space unnecessarily? Another nice thing about zipping is having packages of data, so e.g. you might have a theme packaged in one file (all XML and images). This makes distribution and easy.

This isn't a massive priority to me but it would be a nice addition.