Difference between revisions of "SRT0 (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
Line 123: Line 123:
 
The following tools can handle SRT0 files:
 
The following tools can handle SRT0 files:
 
* [[CTools Pack]] (parsed, but not editable), by [[Chadderz]]
 
* [[CTools Pack]] (parsed, but not editable), by [[Chadderz]]
 +
* [[BrawlBox]], by [[BlackJax]]
  
 
== Links ==
 
== Links ==

Revision as of 05:20, 11 December 2012

Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

This page describes the Mario Kart Wii SRT0 file format, as found within BRRES files. SRT0 files are texture movement animation files.

File Format

File Header

Offset Type Description
0x00 String The magic "SRT0" 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

SRT0 Header

The SRT0 header follows directly after the file header. For SRT0 version 5 it starts at offset 0x1c and has the following layout:

offset size description
0x00 4 Unknown
0x04 2 Frame count
0x06 2 Animation data count
0x08 4 Unknown
0x0c 4 Looping 0x00=disabled 0x01=enabled
0x10 End of header / Start of a filler

Animation Data (Section 0)

The start of section 0 is defned in the file header. It contains the animation data for the file. It starts with a BRRES Index Group. Each of the entries in the index group points to the animation information for one texture.

Texture Animation Data

The structure of the texture animation data which the index group points to has the following layout:

offset size description
0x00 4 String offset to the name of the material to animate.
0x04 4 Texture flags (M bits in this are set)
0x08 4 Unknown
0x0c M*4 Entry offsets
0x0c+M*4 End of structure

The animation animates a given mateiral, with the texture flags field having bits set to indicate which of the 8 possible textures to animate. The entries mentioned in the structure actually describe what to animate about the texture. Each one has the following layout:

offset size description
0x00 4 Animation type code. Determines how much animation data is required (P).
0x04 P*4 Animation data.
0x04+P*4 End of structure

The animation type code is a 32 bit structure with the following layout (msb first):

Bit 1f 1e 1d 1c 1b 1a 19 18 17 16 15 14 13 12 11 10
Meaning Unknown
Bit f e d c b a 9 8 7 6 5 4 3 2 1 0
Meaning Unknown Y fixed X fixed Rotation Fixed Scale Fixed Unknown Fixed Has Unknown Has Translaition Has Rotation Has Scale Unknown

If present, the animation data is stored in the following order:

  1. Unknown
  2. Scale
  3. Rotation
  4. Translation X
  5. Translation Y

If the value is 'fixed' then the animtion data contains a single to set the value to. If it is not fixed, the animation data field contains a pointer to an animation frame data strcutre data, which has the following layout:

offset size description
0x00 2 Frame count (Q)
0x02 2 Unknown
0x04 4 Frame scale (single)
0x08 Q*12 Frame information
0x08+Q*12 End of structure

The frame information data each has the following layout:

offset size description
0x00 4 Tangent (single)
0x04 4 Value (single)
0x08 4 Index (single)
0x0c End of structure

All information about the implementation of these structures is presently Unknown.

Unknown Section (Section 1)

Unknown.

Tools

The following tools can handle SRT0 files:

Links

All about BRRES files

BRRES fileIndex GroupSub Files

CHR0CLR0MDL0PAT0SCN0SHP0SRT0TEX0