CLR0 (File Format)
(Redirected from CLR0)
Jump to navigation
Jump to search
Overview
This page describes the Mario Kart Wii CLR0 file format, as found in BRRES files. They are animation files that swap color.
File Format
File Header
Offset | Type | Description |
---|---|---|
0x00 | String | The magic "CLR0" to identify the sub file. See »BRRES Sub Files« for other magics. |
0x04 | UInt32 | Length of the sub file. |
0x08 | UInt32 | Sub file version number. The number of sections (N) is dependent of this version number. See »BRRES Sub Files« for details. |
0x0C | Int32 | Offset to outer BRRES File. |
0x10 | Int32[N] | N section offsets. N is implied in the version number (offset 0x08). |
0x10+N*4 | Int32 | String offset to the name of this sub file. This name equal to the name of the entry name of the BRRES Index Group pointing to this data. |
0x14+N*4 | End of this header |
File Format CLR v4
The following info describes the v4 format, it may be invalid to other versions. Section 0 contains animation data.
CLR Header
The file header is followed by a CLR header.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Unused. Offset to absolute path of intermediate file. |
0x04 | UInt16 | Frame count. |
0x06 | UInt16 | N = number of animated materials. |
0x08 | UInt32 | Looping (0x00 = Disabled, 0x01 = Enabled). |
0x0c | End of this header |
Material Data (Section 0)
This section starts with a BRRES Index Group. Each one of the entries in the index group points to the animation information for one material.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | String offset to name of the target. |
0x04 | UInt32 | Animation Flag. |
0x08 | End of this section. Beginning of Material Animation Data. |
Animation Flag controls which elements are animated and follows a layout:
Bit | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 |
---|---|---|---|---|---|---|---|---|
Meaning | Unused | Constant TEV Const Register 3 | Has TEV Const Register 3 | Constant TEV Const Register 2 | Has TEV Const Register 2 | Constant TEV Const Register 1 | Has TEV Const Register 1 | |
Bit | f | e | d | c | b | a | 9 | 8 |
Meaning | Constant TEV Const Register 0 | Has TEV Const Register 0 | Constant TEV Register 2 | Has TEV Register 2 | Constant TEV Register 1 | Has TEV Register 1 | Constant TEV Register 0 | Has TEV Register 0 |
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Meaning | Constant Ambient 1 | Has Ambient 1 | Constant Ambient 0 | Has Ambient 0 | Constant Material 1 | Has Material 1 | Constant Material 0 | Has Material 0 |
Material Animation Data
This section contains for each one of used animation targets in the following order:
- Light Channel Material 0
- Light Channel Material 1
- Light Channel Ambient 0
- Light Channel Ambient 1
- Color Register 0
- Color Register 1
- Color Register 2
- Constant Color Register 0
- Constant Color Register 1
- Constant Color Register 2
- Constant Color Register 3
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | RGBA Mask. |
0x04 | UInt32 | Offset to array containing RGBA value for every animation frame. If target is not animated, this field is used as constant value. Offset relative to this field. |
Tools
The following tools can handle CLR0 files:
- BrawlBox, by Kryal and BlackJax.
- BrawlCrate, by soopercool101.
- CTools, by Chadderz (parsed, but not editable).
- SZS Modifier, by Chadderz (parsed, but not editable).