1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

compression LZX's variation

Discussion in 'C' started by Marcoto, Mar 31, 2010.

  1. Marcoto

    Marcoto New Member

    Mar 31, 2010
    Likes Received:
    Trophy Points:
    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.

Share This Page