Drivers - Tricky1975/JCR6_Sharp GitHub Wiki
JCR6 drivers
Basically there are two kinds of drivers you can tie to JCR6. Compression drivers, and filetype drivers.
Compression drivers
Compression drivers are drivers which allow JCR6 to perform compression and expansion based on the chosen algorithm. Due to JCR being a modular set up system it can support ANY compression algorithm as long as the driver for it is present and succesfully loaded. Drivers present by default in C#:
- Store
- lzma
(JCR6 rule is that all driers are named in lower case, and drivers using upper case in any spot in their name are reserved for JCR6 special usage).
Filetype drivers
Allow JCR6 to READ files as if they are JCR6 resources. They can even patch or be patched like JCR6 files can. This is read-only though, as JCR6 can only write in its own native format. File types for which drivers are present:
- "Jeroen's Collected Resource version 6" (JCR6) --> Duh? That's the main format :P
- "Where is All the Data?" (WAD) --> These files are most of all famous for being used in DOOM, Heretic, HeXeN and a few more games.
- "QuakePAK" (PAK) --> Used in Quake 1, I don't know if later instalments of Quake are compatible. Since I deem Quake failed as a game, I never was interested in the later installments.
- "Real Dir" --> Fakes a folder from the normal file system into a JCR6 resource. I've often used this myself for debugging purposes. It's just as patchable as true JCR6 files. Please note that empty directories are ignored, as are files prefixed with a "." as they are deemed "hidden" on unix systems, I bascially followed the unix rules on this.
Loading JCR6 drivers
In C# the drivers are just classes, however unlike Go and BlitzMax where importing the file with the driver was enough to get them to work, C# needs a little activation. This is easy though. Just type:
new JCR6_lzma();
new JCR6_WAD();
new JCR6_QuakePAK();
new JCR6_RealDir();
You don't have to assign them to a variable, and if Visual Studio starts complaining about not being assigned to a variable IGNORE THAT! The classes containing the drivers have been coded to automatically register themselves into the JCR6 class and will assign themselves to the correct variables in those classes.
Creating JCR6 classes
This is very easy, and I will cover this soon ;)