wowlib
0.0.0
Read & write World of Warcraft client files — a C++26 core
Toggle main menu visibility
Loading...
Searching...
No Matches
structure.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <algorithm>
7
#include <array>
8
#include <cstdint>
9
#include <string_view>
10
#include <utility>
11
12
#include <welder/vocabulary.hpp>
13
14
#include <
wowlib/formats/common/flags.hpp
>
15
#include <
wowlib/formats/common/types.hpp
>
16
17
namespace
wowlib::formats::wmo::root::chunks
{
18
// --- MOGI / MGI2 ------------------------------------------------------------
19
20
struct
[[
21
=welder::weld,
22
=welder::doc(
23
"One MOGI entry: per-group flags, bounds and name, mirrored from "
24
"the group file's own header."
)
25
]]
SMOGroupInfo
{
26
[[=welder::doc(
"Group flags; the same GroupFlags bits as MOGP."
)]]
27
group::chunks::GroupFlags
flags
{};
28
29
[[=welder::doc(
"Group bounding box."
)]]
30
CAaBox
boundingBox
{};
31
32
[[=welder::doc(
"Byte offset of the group name in MOGN, -1 for no name."
)]]
33
std::int32_t nameOffset = -1;
34
};
35
36
static_assert
(
sizeof
(
SMOGroupInfo
) == 0x20);
37
38
struct
[[
39
=welder::weld,
40
=welder::doc(R
"(
41
One MGI2 entry (9.0+): group info v2. Same count as MOGI; when present
42
it overrides the older LOD-selection logic.)")
43
]]
GroupInfo2
{
44
[[=welder::doc(
"A copy of the group file's flags2; GroupFlags2 bits."
)]]
45
group::chunks::GroupFlags2
flags2
{};
46
47
[[=welder::doc(
"Which LOD level this group belongs to."
)]]
48
std::uint32_t lodIndex = 0;
49
};
50
51
static_assert
(
sizeof
(
GroupInfo2
) == 0x8);
52
53
// --- MOPT / MOPR / MOPE / MOVB ----------------------------------------------
54
55
struct
[[
56
=welder::weld,
57
=welder::doc(
"One MOPT portal: a polygon plane separating two groups."
)
58
]]
SMOPortal
{
59
[[=welder::doc(
"First vertex in MOPV."
)]]
60
std::uint16_t
startVertex
= 0;
61
62
[[=welder::doc(
"Vertex count."
)]]
63
std::uint16_t count = 0;
64
65
[[=welder::doc(
"The portal plane."
)]]
66
C4Plane
plane{};
67
};
68
69
static_assert
(
sizeof
(
SMOPortal
) == 0x14);
70
71
struct
[[
72
=welder::weld,
73
=welder::doc(
74
"One MOPR entry: a group's reference to a portal and the group "
75
"on the other side."
)
76
]]
SMOPortalRef
{
77
[[=welder::doc(
"Index into MOPT."
)]]
78
std::uint16_t
portalIndex
= 0;
79
80
[[=welder::doc(
"The group on the other side of the portal."
)]]
81
std::uint16_t groupIndex = 0;
82
83
[[=welder::doc(
"Which side of the portal plane this reference looks from."
)]
84
]
85
std::int16_t side = 0;
86
87
[[=welder::doc(
"Alignment filler; zero in client files."
)]]
88
std::uint16_t filler = 0;
89
};
90
91
static_assert
(
sizeof
(
SMOPortalRef
) == 0x8);
92
93
struct
[[
94
=welder::weld,
95
=welder::doc(
96
"One MOPE entry (11.1+): portal extra data; largely undeciphered."
)
97
]]
PortalExtra
{
98
[[=welder::doc(
"Index into MOPT; seems to match MOPR values."
)]]
99
std::uint32_t portalIndex = 0;
100
101
[[=welder::doc(
"Unknown; preserved for round-trip."
)]]
102
std::uint32_t unknown1 = 0;
103
104
[[=welder::doc(
"Unknown; preserved for round-trip."
)]]
105
std::uint32_t unknown2 = 0;
106
107
[[=welder::doc(
"Unknown; preserved for round-trip."
)]]
108
std::uint32_t unknown3 = 0;
109
};
110
111
static_assert
(
sizeof
(
PortalExtra
) == 0x10);
112
113
struct
[[
114
=welder::weld,
115
=welder::doc(
"One MOVB visible block: a vertex range in MOVV."
)
116
]]
SMOVisibleBlock
{
117
[[=welder::doc(
"First vertex in MOVV."
)]]
118
std::uint16_t firstVertex = 0;
119
120
[[=welder::doc(
"Vertex count."
)]]
121
std::uint16_t count = 0;
122
};
123
124
static_assert
(
sizeof
(
SMOVisibleBlock
) == 0x4);
125
}
flags.hpp
Flag-testing convenience for the binary formats' bit-mask enums.
wowlib::formats::wmo::group::chunks::GroupFlags
GroupFlags
Group flag bits (MOGP and MOGI flags).
Definition
header.hpp:22
wowlib::formats::wmo::group::chunks::GroupFlags2
GroupFlags2
Extended group flag bits (MOGP.flags2 and MGI2).
Definition
header.hpp:60
wowlib::formats::wmo::root::chunks
WMO root-file chunk binary structs (MOHD, MOMT, lights, doodads, fog, ambient volumes) and their flag...
Definition
doodad.hpp:17
wowlib::formats::common::C4Plane
A plane as a normal and its signed distance from the origin.
Definition
types.hpp:124
wowlib::formats::common::CAaBox
An axis-aligned bounding box: minimum and maximum corners.
Definition
types.hpp:134
wowlib::formats::wmo::root::chunks::GroupInfo2
Definition
structure.hpp:34
wowlib::formats::wmo::root::chunks::GroupInfo2::flags2
group::chunks::GroupFlags2 flags2
A copy of the group file's flags2; GroupFlags2 bits.
Definition
structure.hpp:36
wowlib::formats::wmo::root::chunks::GroupInfo2::lodIndex
std::uint32_t lodIndex
Which LOD level this group belongs to.
Definition
structure.hpp:39
wowlib::formats::wmo::root::chunks::PortalExtra
Definition
structure.hpp:82
wowlib::formats::wmo::root::chunks::PortalExtra::unknown3
std::uint32_t unknown3
Definition
structure.hpp:93
wowlib::formats::wmo::root::chunks::PortalExtra::portalIndex
std::uint32_t portalIndex
Definition
structure.hpp:84
wowlib::formats::wmo::root::chunks::PortalExtra::unknown1
std::uint32_t unknown1
Definition
structure.hpp:87
wowlib::formats::wmo::root::chunks::PortalExtra::unknown2
std::uint32_t unknown2
Definition
structure.hpp:90
wowlib::formats::wmo::root::chunks::SMOGroupInfo
One MOGI entry: per-group flags, bounds and name, mirrored from the group file's own header.
Definition
structure.hpp:21
wowlib::formats::wmo::root::chunks::SMOGroupInfo::nameOffset
std::int32_t nameOffset
Byte offset of the group name in MOGN, -1 for no name.
Definition
structure.hpp:29
wowlib::formats::wmo::root::chunks::SMOGroupInfo::boundingBox
CAaBox boundingBox
Group bounding box.
Definition
structure.hpp:26
wowlib::formats::wmo::root::chunks::SMOGroupInfo::flags
group::chunks::GroupFlags flags
Group flags; the same GroupFlags bits as MOGP.
Definition
structure.hpp:23
wowlib::formats::wmo::root::chunks::SMOPortalRef
One MOPR entry: a group's reference to a portal and the group on the other side.
Definition
structure.hpp:61
wowlib::formats::wmo::root::chunks::SMOPortalRef::groupIndex
std::uint16_t groupIndex
The group on the other side of the portal.
Definition
structure.hpp:66
wowlib::formats::wmo::root::chunks::SMOPortalRef::portalIndex
std::uint16_t portalIndex
Index into MOPT.
Definition
structure.hpp:63
wowlib::formats::wmo::root::chunks::SMOPortal
One MOPT portal: a polygon plane separating two groups.
Definition
structure.hpp:47
wowlib::formats::wmo::root::chunks::SMOPortal::startVertex
std::uint16_t startVertex
First vertex in MOPV.
Definition
structure.hpp:49
wowlib::formats::wmo::root::chunks::SMOPortal::count
std::uint16_t count
Vertex count.
Definition
structure.hpp:52
wowlib::formats::wmo::root::chunks::SMOPortal::plane
C4Plane plane
The portal plane.
Definition
structure.hpp:55
wowlib::formats::wmo::root::chunks::SMOVisibleBlock
Definition
structure.hpp:101
wowlib::formats::wmo::root::chunks::SMOVisibleBlock::firstVertex
std::uint16_t firstVertex
Definition
structure.hpp:103
wowlib::formats::wmo::root::chunks::SMOVisibleBlock::count
std::uint16_t count
Definition
structure.hpp:106
types.hpp
The binary-level math and color primitives shared across WoW file formats (wowdev....
src
wowlib
formats
wmo
root
chunks
structure.hpp
Generated by
1.17.0