MREA (Metroid Prime 3): Difference between revisions

Jump to navigation Jump to search
>Aruki
>Aruki
Line 18: Line 18:
! Offset
! Offset
! Type
! Type
! Size
! Count
! Description
! Name
! Notes
|-
|-
| 0x0
| 0x0
| u32
| u32
| 4
| 1
| '''Magic Number'''; always 0xDEADBEEF
| '''Magic'''
| Always <code>0xDEADBEEF</code>.
|-
|-
| 0x4
| 0x4
| u32
| u32
| 4
| 1
| '''Version'''; see [[MREA (File Format)|hub article]]
| '''Version'''
| See [[MREA (File Format)|hub article]] for a list of possible version numbers.
|-
|-
| 0x8
| 0x8
| float[12]
| float
| 48
| 12
| '''Transform matrix''' (transform of the area in world space)
| '''Area Transform'''
| Matrix that represents the area's transform from the origin. Most area data is pre-transformed, so this matrix is only used occasionally.
|-
|-
| 0x38
| 0x38
| u32
| u32
| 4
| 1
| '''Mesh count'''
| '''World Model Count'''
| Number of world models in this area.
|-
|-
| 0x3C
| 0x3C
| u32
| u32
| 4
| 1
| '''Layer count'''
| '''Script Layer Count'''
| Number of script layers in this area.
|-
|-
| 0x40
| 0x40
| u32
| u32
| 4
| 1
| '''Section count''' (SC)
| '''Data Section Count'''
| Number of data sections in the file.
|-
|-
| 0x44
| 0x44
| u32
| u32
| 4
| 1
| '''Compressed block count'''
| '''Compressed Block Count'''
| Number of compressed data blocks in the file.
|-
|-
| 0x48
| 0x48
| u32
| u32
| 4
| 1
| '''Section number count'''
| '''Section Number Count'''
| Number of section numbers at the end of the header.
|-
|-
| 0x4C
| 0x4C
| u32[5]
| u8
| 0x14
| 0x14
| '''Padding'''
| '''Padding'''
| Padding bytes that align the file with the next multiple-of-32 offset.
|-
|-
| 0x60
| 0x60
| u32[SC]
| u32
| -
| ''Data Section Count''
| '''Section sizes'''
| '''Data Section Sizes'''
| Array containing the size of each data section in the file. Every size is always a multiple of 32.
|-
|-
| colspan=4 {{unknown|End of main header data; pad to 32 bytes before compressed section definitions}}
| colspan=5 {{unknown|End of main header data; pad to 32 bytes before compressed section definitions}}
|}
|}


Line 117: Line 128:
==== Section Numbers ====
==== Section Numbers ====


The section numbers portion of the header indicates the section index of each major data chunk. Some of these chunks contain multiple sections; in that case the number will point to the first section of the chunk. Each number is a short 8-byte struct:
The section numbers portion of the header indicates the section index of each major data chunk. Some of these chunks contain multiple sections; in that case the number will point to the first section of the chunk. <code>WOBJ</code> can be listed multiple times, but its section index is always 0. Every other section number always appears in every MREA file once (none are optional). Each number is a short 8-byte struct:


{| class="wikitable"
{| class="wikitable"
Anonymous user

Navigation menu