Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   compression LZX's variation (http://www.go4expert.com/forums/compression-lzxs-variation-t21599/)

Marcoto 31Mar2010 20:41

compression LZX's variation
Hello, I would like to know if someone can help me to do a bookshop for unpack a few files of textures or at least, that it(he,she) throws a bit of light and indicates me like to begin.
Pardon for the translations of goolge, they are pernicious...

Every GTAIV resource (xtd-textures for example) has got following stucture:
4 bytes - Magic ('RSC')
4 bytes - Type (version - textures has "7")
4 bytes - Flags
<<Data in ZLIB on PC and LZX on XBox360>>
From 'flags' value can be calculated sizes of SysSegment and GpuSegment of unpacked data.

CpuSegSiz := (flags and $7FF) shl (((flags shr 11) and $F) + 8);
  GpuSegSiz := ((flags shr 15) and $7FF) shl (((flags shr 26) and $F) +  8);


uint systemSegSize = (flags & 0x7FF) << (((flags >> 11)  & 0xF) + 8);
uint gpuSegSize = ((flags >> 15) & 0x7FF)  << (((flags >> 26) & 0xF) + 8);

Of course on PC everything is very easy because of primitive compression, but I dont know how to work with X360 data. Here it is archive which includes three examples of texture RSC.

I believe that the compression is LZX's variation.

All times are GMT +5.5. The time now is 14:22.