Topic: Extracting layer data out of .map file
Hi Community,
I'm currenty developing a small tool for TW that collects map data out of the .map files.
I'm not sure what features it is going to have later yet, at first I want to make the extracting work.
I read a lot in the source code and found out the in version four the rawdata is stored compressed with the deflate algo from zlib.
Now my problem:
I want to write my tool in C# and I tried a lot of C# zlib implementations but noone gives me the result expected.
The uncompressed size never matches the one written in the terminal by TW (Editor).
The first thing that helped me was to replace all bytes containing an 32 (interger) by an byte containing a 0.
This gives me the correct image names, but the quadlayer data still doesn't work.
The zlib inflate return an "incorrect data check" error and going into the code shows me that zlib starts checking too early, e.g. for standart ctf5, group 1, first (and only) quadlayer only 63 bytes were read but it should be 79.
Do I have to replace something else that inflate dosn't start checking too early or is there a proplem with the encoding or something else?
I would be great if someone could help me,
Thanks
Teebeutel