Difference between revisions of "BREFT (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
m
Line 9: Line 9:
 
! Offset !! Size !! Type !! Description
 
! Offset !! Size !! Type !! Description
 
|-
 
|-
| 0x00 || 0x04 || UInt32 || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in [[Mario Kart Wii]].
+
| 0x00 || 0x04 || UInt32 || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in [[Mario Kart Wii]].
 
|-
 
|-
 
| 0x04 || 0x02 || UInt16 || Width of texture in pixel (values in the range 0x8-0x100).
 
| 0x04 || 0x02 || UInt16 || Width of texture in pixel (values in the range 0x8-0x100).
Line 20: Line 20:
 
Found in MKW: 7* 0x00, 675* 0x01, 462* 0x03, 5* 0x04, 25* 0x05, 2* 0x06, 24* 0x0E
 
Found in MKW: 7* 0x00, 675* 0x01, 462* 0x03, 5* 0x04, 25* 0x05, 2* 0x06, 24* 0x0E
 
|-
 
|-
| 0x0D || 0x03 || Byte[3] || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in MKW. Perhaps 0x0C is a mistake and a little endian 32-bit number.
+
| 0x0D || 0x03 || Byte[3] || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in MKW. Perhaps 0x0C is a mistake and a little endian 32-bit number.
 
|-
 
|-
| 0x10 || 0x04 || UInt32 || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
+
| 0x10 || 0x04 || UInt32 || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
 
|-
 
|-
 
| 0x14 || 0x01 || Byte || Null or the total number of images (main image + mipmaps). In MKW only 2 files have the value of 2 here (factory_course.szs and _d variant, effect/Alarm/rk_alarm.breft, alarmMip). For all other files the value is 0.
 
| 0x14 || 0x01 || Byte || Null or the total number of images (main image + mipmaps). In MKW only 2 files have the value of 2 here (factory_course.szs and _d variant, effect/Alarm/rk_alarm.breft, alarmMip). For all other files the value is 0.
 
|-
 
|-
| 0x15 || 0x03 || Byte[3] || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in MKW. Perhaps 0x14 is a mistake and a little endian 32-bit number.
+
| 0x15 || 0x03 || Byte[3] || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in MKW. Perhaps 0x14 is a mistake and a little endian 32-bit number.
 
|-
 
|-
| 0x18 || 0x04 || UInt32 || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
+
| 0x18 || 0x04 || UInt32 || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
 
|-
 
|-
| 0x1C || 0x04 || UInt32 || style="text-align: left;" {{Unknown|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
+
| 0x1C || 0x04 || UInt32 || {{Unknown-left|'''Unknown'''.}} Null for all 1200 BREFT files in MKW.
 
|-
 
|-
 
| 0x20 || '''N''' || UInt32 || Texture data.
 
| 0x20 || '''N''' || UInt32 || Texture data.
 
|-
 
|-
| 0x20 + '''N''' || colspan=3 {{unknown|End of sub file}}
+
| 0x20 + '''N''' || colspan=3 {{Unknown|End of sub file}}
 
|}
 
|}
  

Revision as of 09:38, 20 November 2016

Introduction

Read BREFF and BREFT (File Format) for an introduction.

File Format

A BREFT sub file starts with a header of 32 bytes followed by the texture data. The Sub File Item explained here points to this header. The size of the sub file item only counts the size of the texture data.

Offset Size Type Description
0x00 0x04 UInt32 Unknown. Null for all 1200 BREFT files in Mario Kart Wii.
0x04 0x02 UInt16 Width of texture in pixel (values in the range 0x8-0x100).
0x06 0x02 UInt16 Height of texture in pixel (values in the range 0x10-0x100).
0x08 0x04 UInt32 N = size of texture data.
0x0C 0x01 Byte Image format of texture (see below for details).

Found in MKW: 7* 0x00, 675* 0x01, 462* 0x03, 5* 0x04, 25* 0x05, 2* 0x06, 24* 0x0E

0x0D 0x03 Byte[3] Unknown. Null for all 1200 BREFT files in MKW. Perhaps 0x0C is a mistake and a little endian 32-bit number.
0x10 0x04 UInt32 Unknown. Null for all 1200 BREFT files in MKW.
0x14 0x01 Byte Null or the total number of images (main image + mipmaps). In MKW only 2 files have the value of 2 here (factory_course.szs and _d variant, effect/Alarm/rk_alarm.breft, alarmMip). For all other files the value is 0.
0x15 0x03 Byte[3] Unknown. Null for all 1200 BREFT files in MKW. Perhaps 0x14 is a mistake and a little endian 32-bit number.
0x18 0x04 UInt32 Unknown. Null for all 1200 BREFT files in MKW.
0x1C 0x04 UInt32 Unknown. Null for all 1200 BREFT files in MKW.
0x20 N UInt32 Texture data.
0x20 + N End of sub file

Image Formats

Image Formats
ID Name Bits per pixel Block width Block height Block size Type
0x00 I4 4 8 8 32 bytes Gray
0x01 I8 8 8 4 32 bytes Gray
0x02 IA4 8 8 4 32 bytes Gray + Alpha
0x03 IA8 16 4 4 32 bytes Gray + Alpha
0x04 RGB565 16 4 4 32 bytes Color
0x05 RGB5A3 16 4 4 32 bytes Color + Alpha
0x06 RGBA32 (RGBA8) 32 4 4 64 bytes Color + Alpha
0x08 C4 (CI4) 4 8 8 32 bytes Palette (IA8, RGB565, RGB5A3)
0x09 C8 (CI8) 8 8 4 32 bytes Palette (IA8, RGB565, RGB5A3)
0x0A C14X2 (CI14x2) 16 4 4 32 bytes Palette (IA8, RGB565, RGB5A3)
0x0E CMPR 4 8 8 32 bytes Color + optional Alpha (compressed)

Tools

The following tools can handle BREFT files: