Geometry

Geometry

Geometries

Offset (bytes)

Size (bytes)

Name

Description

0

varies

nested_geometries

Vector of Geometry objects (usually one, but can be more).

struct Geometries

Represents a collection of geometry objects in the battle stage. There may be more than one Geometry object. Check for 01 00 01 00 to know if there are one or more.

Public Members

std::vector<Geometry> nested_geometries = {}

Vector of Geometry objects (usually one, but can be more).

Public Static Attributes

static constexpr std::array<char, 4> START_OF_HEADER = {1, 0, 1, 0}

Sequence indicating the start of a header.

Geometry

Offset (bytes)

Size (bytes)

Name

Description

0

6

geometry_header1

First header of the geometry object.

6

varies

vertice

Vector of vertice.

varies

4-7

padding

Padding formula.
Position after read the vertice.
\((position \; \% \; 4) + 4\)

varies

8

geometry_header2

second header of the geometry object.

varies

varies

triangles

Vector of triangles.

varies

varies

quads

Vector of quads.

struct Geometry

Represents a geometry object in the battle stage.

Public Members

GeometryHeader1 geometry_header1 = {}

First header of the geometry object.

std::vector<graphics::Vertice<std::int16_t>> vertices = {}

Vector of vertices.

GeometryHeader2 geometry_header2 = {}

Second header of the geometry object.

std::vector<Triangle> triangles = {}

Vector of triangles.

std::vector<Quad> quads = {}

Vector of quads.

Public Static Functions

template<std::integral numT>
static inline numT calc_pad(numT position)

Calculate the padding after reading vertices.

Parameters:

position – The current position in bytes.

Returns:

The number of bytes to skip.

First Header

Total Size: 6 bytes

Offset (bytes)

Size (bytes)

Name

Description

0

2

m_always_1_0_1

Always 0x0001

2

2

m_always_1_0_2

Always 0x0001

4

2

m_number_vertices

Number of vertice

struct GeometryHeader1

Public Functions

GeometryHeader1() = default

default constructor.

inline explicit GeometryHeader1(std::uint16_t number_vertices)

Construct a new GeometryHeader1 object.

Parameters:

number_vertices – The number of vertices in the geometry object.

inline const auto &number_vertices() const noexcept

Get the number of vertices in the geometry object.

Returns:

The number of vertices.

inline bool test() const noexcept

Check if the geometry header is valid.

Returns:

true if the header is valid, false otherwise.

Public Static Attributes

static constexpr std::size_t EXPECTED_SIZE = 6U

Expected size of the GeometryHeader1 struct in bytes.

Second Header

Total Size: 8 bytes

Offset (bytes)

Size (bytes)

Name

Description

0

2

m_triangle_count

Number of triangles

2

2

quad_count

Number of quads

4

4

m_padding

Padding to maintain alignment

struct GeometryHeader2

Public Functions

inline const auto &triangle_count() const noexcept

Get the number of triangles in the geometry object.

Returns:

The number of triangles.

inline const auto &quad_count() const noexcept

Get the number of quads in the geometry object.

Returns:

The number of quads.

Public Static Attributes

static constexpr std::size_t EXPECTED_SIZE = 8U

Expected size of the GeometryHeader2 struct in bytes.