Chapter 3 Binary Format

3-6 Shape List

2. Shape Area

The Shape area describes data regarding a shape. Mapping for this area is as follows.

u32 | shape_tag
u32 | this_shape_index
u32 | shape_size
u32 | shape_name_index
u32 | shape_type
u32 | shape_tri_link
u32 | shape_mat_link
u32 | shape_part_num
u32 | nintendo_extension_block_size
u32 | user_extension_block_size
u32 | shape_part_link(0)
...
u32 | shape_part_link(shape_part_num - 1)
NintendoExtensionBlock
UserExtensionBlock

Figure: Shape Area Memory Map

u32 shape_tag | Tag indicating Shape. Set the following flag.
    TAG_SHAPE	0x00030100
u32 this_shape_index | Index number of this Shape
u32 shape_size | Size of this Shape
u32 shape_name_index | Index number of shape name in NameList
u32 shape_type | Type of Shape. Currently, the following flags are defined.
    SHAPE_TYPE_CLEAR	0x00000000
    SHAPE_TYPE_AA		0x00000001
    SHAPE_TYPE_RA		0x00000002
    SHAPE_TYPE_ZB		0x00000004
    SHAPE_TYPE_CULL_BACK	0x00000010
    SHAPE_TYPE_CULL_FRONT	0x00000020
    SHAPE_TYPE_CULL_BOTH	0x00000030
SHAPE_TYPE_CLEAR clears Shape type. SHAPE_TYPE_AA performs anti-alias process. SHAPE_TYPE_RA performs reduced alias process. SHAPE_TYPE_ZB performs z-buffer process. SHAPE_TYPE_CULL_BACK performs back-face culling.

SHAPE_TYPE_CULL_FRONT performs front-face culling.

SHAPE_TYPE_CULL_BOTH performs culling.

SHAPE_TYPE_AA and SHAPE_TYPE_RA cannot be specified both at the same time. Also, when specifying SHAPE_TYPE_CULL_*, only one of the above (BACK, FRONT and BOTH) can be specified.

When shape data is put through the anti-alias, z buffer and back-face culling processes, set flag as below.

    SHAPE_TYPE_AA | SHAPE_TYPE_ZB | SHAPE_TYPE_CULL_BACK

u32 shape_tri_link | Index number of TriGroup in TriList
u32 shape_mat_link | Index number of MatList If Mat is not linked, set the following flag.
    SHAPE_MAT_LINK	0xffffffff
u32 shape_part_num | Number of Parts contained in Shape Set the following flag if the Part node is not linked.
    SHAPE_NOPART	0x00000000
u32 nintendo_extension_block_size | Nintendo extension block size
u32 user_extension_block_size | User extension block size
u32 shape_part_link | Index number of PartList If shape_part_num = SHAPE_NOPART, this field is ignored.
NintendoExtensionBlock | Nintendo extension block
UserExtensionBlock | User extension block