GRAF:Aglaia Online

From XentaxWiki
Jump to: navigation, search

TXB

  • Format Type : Compressed image (8bpp or 32bpp)
  • Endian Order : Little Endian
  • Forum Threads : None
  • Date Posted : December 4th 2005 05:22 AM


Format Specifications

char {4}     - Header (TXB )
uint16 {2}   - Image Width
uint16 {2}   - Image Height
uint32 {4}   - Palette Type (1/3)
byte {20}    - null

if (paletteType == 1){

// for each color (256)
byte {1}     - Alpha
byte {1}     - Red
byte {1}     - Green
byte {1}     - Blue
}


byte {X}     - Compressed Pixel Data (ZLib)

// When the compressed pixel data is decompressed...{

if (paletteType == 1){
for (width*height){
byte {1}     - Palette Index
}
}


else if (paletteType == 3){
for (width*height){
byte {1}     - Blue
byte {1}     - Green
byte {1}     - Red
byte {1}     - Alpha
}
}


uint64 {8}   - null
byte {16}    - Signature (TRUEVISION-XFILE)
byte {1}     - Tag (0x2E)
byte {1}     - null
}

Notes and Comments

Image Data is a ZLIB compressed buffer (hint : it start with an 'x'). Give it to the uncompress() function of ZLIB and you obtain the uncompressed image. The format of this uncompressed image can be of 2 sort, depending of the Palette Type. Whatever the format, after the pixels it has a footer of 26 bytes. Note that the pixels are from bottom to top, and for each row are left to right. The Alpha Channel is used in certain TXB of the game, it's not here just for padding.

If Palette Type == 1 then the uncompressed image contain palette indexs. Its size is 26 + (Width * Height) bytes.


If Palette Type == 3 then the uncompressed image contain a true color image. Here, the image size is 26 + (4 * Width * height) bytes. Each pixel is in BGRA format.


The footer is 26 bytes, structured like that :

byte {8}  - null
byte {16} - signature "TRUEVISION-XFILE"
byte {1}  - Tag 0x2E
byte {1}  - null


MultiEx BMS Script

Not written yet


Supported by Programs

None


Other Games

None