Monday, 23 January 2017

I76 Parser Code

I'd been planning to do a little more to clean this up, but keep getting distracted, so for now here's some code that can do I76 game file translation.

This is a dump of the current I76 exporter as it's sitting on my hard disk. It compiles with Qt5.6 (or better), lzo and opencv on Linux. LZO is needed to unpack the compressed file resources in the Nitro Pack, and OpenCV is used to handle some of the higher bitdepth images that are created when level dumps are processed. Qt 5.6 is needed because of some of the utility bitmap functions I used in QImage. These dependencies should be replaceable for the motivated who only need a subset of the functionality.

It's been built up as I went along figuring out the formats, so it's very hacky in places, and could be much nicer if rewritten from scratch and knowing what's available in which files. However it works for me as is (tm).

Just qmake in the source directory, then make and the resulting binary is i76_converter. Run this with the name of a file to process on the command line.

Run it with the ZFS file from the game itself and it will unpack the individual resource files from the ZFS. If run with one of the resource files from the game (either from the ZFS or game disks) then it will report information and possibly create a more usable export, depending on the type of file (and how much of the debug is commented out).