mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 13:34:57 +00:00
How to decompress the compressed DirectX file format #332
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @s520 on GitHub (Nov 16, 2018).
I am trying to load a compressed DirectX file format.
The structure of this compressed X file is as follows.
First, the first 16 bytes are the header.
The next 4 bytes represent the size of the decompressed X file including the header.
After that one or more data blocks are arranged.
The structure of the data block is as follows.
The first two bytes represent the size after decompression of that compressed block.
The next two bytes represent the size of that compressed block.
After that, it is compressed block in MSZIP format.
Currently I succeeded in decompressing the first data block, but I have failed to decompress after the second one.
I attach a sample file and a sample program that performs decompression.
DecompressedXFileTest.zip
First, "test1.x" is a file which succeeds in decompression.
The result after the extension "test1.result.x" matches the expected result "test1.expectedResult.x".
Next, "test2.x" is a file that fails to decompress.
"test2.result.x" which is the result after elongation does not match the expected result "test2.expectedResult.x".
The difference between "test1.x" and "test2.x" is whether the number of data blocks is one or more.
How can I properly decompress "test2.x"?
(This issue is related to #418 .)
@s520 commented on GitHub (Nov 22, 2018):
This problem was resolved with the following pull request.
https://github.com/leezer3/OpenBVE/pull/291