14#include <welder/vocabulary.hpp>
24 "Per-cell texture-layer flag bits (SMLayer.flags). The low 6 bits "
25 "hold the animation rotation (0x7) and speed (0x38); see "
26 "SMLayer.animation_rotation()/animation_speed().")
29 Overbright [[=welder::doc(
"Render much brighter (used for glowing lava).")]] = 0x80,
31 "This layer blends through an MCAL alpha map (set on every "
32 "layer after the first).")]] = 0x100,
34 "The layer's MCAL alpha map is RLE-compressed on "
35 "disk. wowlib decodes it either way; on write it "
36 "re-compresses when this bit is set.")]] = 0x200,
38 "Treat the ground layer as a skybox reflection "
39 "(needs an MTXF entry).")]] = 0x400,
41 "WoD?+ with 0x1000: apply the texture-effect texture "
50 =welder::weld_as(
"SMLayer"),
52 A terrain texture layer (MCLY, 16 bytes): which tileset texture, the
53 blend/animation flags and the ground-effect link. Layers after the first
54 blend through an alpha map (see MapChunk.alphaMaps). The MCAL offset is
55 derived on write and not exposed.)")
58 "The texture: an index into the tile's texture list (MTEX names, or "
59 "the MDID FileDataID table since 8.1).")]]
63 "Flags; LayerFlags bits (the low 6 bits are animation rotation/speed).")]]
66 [[=welder::mark::exclude]] std::uint32_t offsetInMcal = 0;
69 "The ground-effect link (a GroundEffectTexture foreign key), or -1 for "
70 "none (in the alpha clients, a u16 + padding).")]]
71 std::int32_t effectId = -1;
74 [[=welder::getter, =welder::doc(
75 "The animation direction in 45-degree steps (flag bits "
77 std::uint32_t animationRotation()
const {
return std::to_underlying(
flags) & 0x7; }
80 [[=welder::getter, =welder::doc(
"The animation speed (flag bits 0x38).")]]
81 std::uint32_t animationSpeed()
const {
82 return (std::to_underlying(
flags) >> 3) & 0x7;
85 bool operator==(
const SMLayer&)
const =
default;
88 static_assert(
sizeof(
SMLayer) == 0x10);
96 =welder::weld_as(
"SMTextureFlags"),
98 Flags for a tileset texture (MTXF, WotLK+): one per MTEX entry. Bit 0
99 disables specular/height shading and uses a cube map; bits 4-7 hold the
100 texture scale exponent (UVs are divided by 1 << that nibble, so the
101 texture appears 2^n times larger).)")
104 "Flags: bit 0 = use cube map (no _s/_h shading); bits 4-7 = texture "
105 "scale exponent (UVs are divided by 1 << n).")]]
106 std::uint32_t flags = 0;
117 =welder::weld_as(
"SMTextureParams"),
119 Height-blend parameters for a tileset texture (MTXP, MoP+): the same flags
120 as MTXF plus the _h texture's height scale and offset. Scale 0.0 / offset
121 1.0 means no _h texture is loaded.)")
123 [[=welder::doc("Flags, as in MTXF.")]]
124 std::uint32_t flags = 0;
127 "Height scale: _h values map to [0, height_scale) as the blend height "
129 float heightScale = 0;
131 [[=welder::doc(
"Height offset added to the scaled _h value (default 1.0).")]
133 float heightOffset = 1;
135 [[=welder::doc(
"Padding.")]]
136 std::uint32_t padding = 0;
146 =welder::weld_as(
"SMTerrainMaterial"),
148 "Per-layer terrain material ids (MCMT, Cata+): four TerrainMaterial "
149 "foreign keys, one per MCLY layer.")
151 [[=welder::doc(
"The four per-layer material ids.")]]
152 std::array<std::uint8_t, 4> materialId{};
163 =welder::weld_as(
"SMTextureColorGrading"),
165 Color-grading info for a tileset texture (MTCG, Shadowlands+): a start
166 distance pair and the color-grading LUT / ramp FileDataIDs applied to the
167 diffuse texture at the same index.)")
170 "Start distance (the record is used when this or _04 is non-zero).")]]
171 std::uint32_t startDistance = 0;
178 =welder::doc(
"Unknown companion of start_distance.")]]
179 std::uint32_t _04 = 0;
181 [[=welder::doc(
"The color-grading LUT FileDataID.")]]
182 std::uint32_t colorGradingFdid = 0;
184 [[=welder::doc(
"The color-grading ramp FileDataID.")]]
185 std::uint32_t colorGradingRampFdid = 0;
199 A terrain vertex normal (MCNR entry, 3 signed bytes): the X, Z, Y
200 components, 127 == 1.0. One per MCVT height vertex (9x9 + 8x8 = 145).)")
203 "The normal components, plain X, Y, Z order; 127 == 1.0, -127 == -1.0. (The often-quoted X, Z, Y layout is wrong: verified empirically against MCVT-derived gradients, wrender 2026-08.)")
205 std::array<std::int8_t, 3> normal{};
207 bool operator==(
const MCNREntry&)
const =
default;
210 static_assert(
sizeof(MCNREntry) == 3);
Binding-language identities welder's core does not name.
constexpr welder::lang Cs
C#/.NET — the welder-csharp rod's identity (user-range slot 0), respelled for wowlib's annotation sit...
One MCNR normal (3 signed bytes, x Z Y; 127 == 1.0).
std::array< std::int8_t, 3 > normal
bool operator==(const MCNREntry &) const =default
One MTCG color-grading record (Shadowlands+): the color-grading LUT FileDataIDs for the same-index di...
std::uint32_t colorGradingRampFdid
std::uint32_t startDistance
std::uint32_t colorGradingFdid
bool operator==(const SMTextureColorGrading &) const =default
One MTXF texture-flags record (WotLK+): flags for the same-index MTEX texture.
std::uint32_t flags
Flags: bit 0 = use cube map (no _s/_h shading); bits 4-7 = texture scale exponent (UVs are divided by...
bool operator==(const SMTextureFlags &) const =default
One MTXP texture-parameter record (MoP+): the MTXF flags plus the _h height-texture scale/offset that...
std::uint32_t flags
Flags, as in MTXF.
float heightScale
Height scale: _h values map to [0, height_scale) as the blend height (default 0.0).
The binary-level math and color primitives shared across WoW file formats (wowdev....