Crunch CRN: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
imported>Ikskoks
(Created page with "{{GRAFPageHeader}} == CRN == * ''' Format Type ''': Image / Texture <br> * ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br> * ''' Signa...")
imported>Ikskoks
 
(11 intermediate revisions by the same user not shown)
Line 3: Line 3:


* ''' Format Type ''':    Image / Texture <br>  
* ''' Format Type ''':    Image / Texture <br>  
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Big Endian <br>
* ''' Signature ''':    Hx <br>  
* ''' Signature ''':    Hx <br>  


Line 78: Line 78:
=== Games ===  
=== Games ===  
List of games using this file format:
List of games using this file format:
* Star Stable Online (uses modified CRN file with extra header)
* Neverwinter (*.WTEX / *.HTEX)
* Star Stable Online (*.PTE / *.TGA) (PC) (uses modified CRN file with extra header)
* Star Trek Online (*.WTEX / *.HTEX)


=== Compatible Programs ===  
=== Compatible Programs ===  
Line 84: Line 86:
* [https://github.com/BinomialLLC/crunch crunch]
* [https://github.com/BinomialLLC/crunch crunch]
* [https://forum.xentax.com/download/file.php?id=21520 crunch_unity] (special crunch version compiled for Unity games)
* [https://forum.xentax.com/download/file.php?id=21520 crunch_unity] (special crunch version compiled for Unity games)
* Noesis + [https://forum.xentax.com/viewtopic.php?p=135948#p135948 crunch plugins]
<br/><br>
<br/><br>



Latest revision as of 21:58, 1 February 2022

Back to index | Edit this page

CRN

  • Format Type : Image / Texture
  • Endian Order : Big Endian
  • Signature : Hx


Format Specifications

// crn texture header (big endian) - 74 bytes
2 bytes (char) - signature // "Hx"
2 bytes (uint16) - header size   // e.g. 106 
2 bytes (uint16) - header CRC16 
4 bytes (uint32) - data size  
2 bytes (uint16) - data CRC16
2 bytes (uint16) - width
2 bytes (uint16) - height
1 byte (uint8) - mipmap level index // 0 is the largest/first level
1 byte (uint8) - number of faces
1 byte (uint8) - format number
2 bytes (uint16) - flags
4 bytes (uint32) - reserved
4 bytes (uint32) - user data 0
4 bytes (uint32) - user data 1

8 bytes - color endpoints (palette structure)
8 bytes - color selectors (palette structure)
8 bytes - alpha endpoints (palette structure)
8 bytes - alpha selectors (palette structure)

2 bytes (uint16) - tables size
3 bytes - tables offsets
4 bytes - levels offsets


x bytes - compressed image data

Related Structures

// Palette structure

3 bytes - offsets
3 bytes - size
2 bytes - num

CRC calculation

  • CRC16 calculation can be described as below:
// header crc16
const uint32 header_crc = crc16(&pHeader->m_data_size, (uint32)(pHeader->m_header_size - ((const uint8*)&pHeader->m_data_size - (const uint8*)pHeader)));

//data crc16
const uint32 data_crc = crc16((const uint8*)pData + pHeader->m_header_size, pHeader->m_data_size - pHeader->m_header_size);

// Note: More details in "crn_decomp.h" file.

MultiEx BMS Script

Not written yet.

Notes and Comments

  • This file format occurs in games using crunch library.

Games

List of games using this file format:

  • Neverwinter (*.WTEX / *.HTEX)
  • Star Stable Online (*.PTE / *.TGA) (PC) (uses modified CRN file with extra header)
  • Star Trek Online (*.WTEX / *.HTEX)

Compatible Programs