diff options
Diffstat (limited to 'doc/respack.md')
-rw-r--r-- | doc/respack.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/respack.md b/doc/respack.md new file mode 100644 index 0000000..eb316c0 --- /dev/null +++ b/doc/respack.md @@ -0,0 +1,22 @@ +# Resource Package Format + +Multiple related resources can be packages into a single file for easier +distribution and storage outside of the game. + +A resource pack has a header describing the layout of the contained resources. +It maps resource hashes to absolute offset-size ranges in file. There is no +guarantee that the resource data is tightly packed in the file. There may also +be an entry point resource specified which is of type `RespackEntry`, or not in +which case the field is zeroed. + +``` +MMMM EEEEEEEE CC [RRRRRRRR OO SS]... Data... +^ ^ ^ ^ ^ ^ +| | | | | | Size (u64) +| | Entry Point Res | Offset (u64) +| Magic bytes | | Resource hash (256-bit) + | Resources count +``` + +The magic bytes are `0f0c 5745 4152 4501 5245 5350 4143 4b02` +(`\x0f\x0cWEARE\x01RESPACK\x02`). |