mirror of https://git.do.srb2.org/STJr/wadzip.git
43 lines
1.1 KiB
Markdown
43 lines
1.1 KiB
Markdown
|
# wadzip utility
|
||
|
|
||
|
SRB2's own zipped WAD format compression tool.
|
||
|
|
||
|
## License
|
||
|
|
||
|
Copyright (C) Sonic Team Junior, 2015
|
||
|
|
||
|
This code is made available under the terms of the GNU General Public License, version 2. You can see that license [here](http://www.gnu.org/licenses/gpl-2.0.html).
|
||
|
|
||
|
## Instructions
|
||
|
|
||
|
Compressed wad format:
|
||
|
|
||
|
Just like a normal wad, except:
|
||
|
|
||
|
1. The header id at the very beginning says "ZWAD"
|
||
|
instead of PWAD or IWAD.
|
||
|
|
||
|
2. The first four bytes of each lump are (little
|
||
|
endian) the uncompressed size. If this is zero,
|
||
|
the lump is not compressed, and you can subtract
|
||
|
four from the size given in the wadfile directory.
|
||
|
|
||
|
3. Unless those first four bytes give a value of
|
||
|
0, the lump is compressed with liblzf after that.
|
||
|
|
||
|
|
||
|
|
||
|
To compile this program, just compiling all its
|
||
|
source files should work, that is:
|
||
|
gcc *.c -o wadzip
|
||
|
|
||
|
[On a big-endian CPU, add "-DWORDS_BIGENDIAN" to
|
||
|
that command line.]
|
||
|
|
||
|
Visual C++ should also work, as well as gcc.
|
||
|
|
||
|
Compress a wad:
|
||
|
wadzip c original.wad compressed.wad
|
||
|
Decompress a wad (restoring the original):
|
||
|
wadzip d compressed.wad original.wad
|