wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
skin.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <cstdint>
11
12#include <welder/vocabulary.hpp>
13
15#include <wowlib/core/lang.hpp>
19
22 inline constexpr std::uint32_t SkinMagic = 0x4E494B53; // "SKIN"
23
32 struct [[
33 =welder::weld,
34 =welder::weld_as("Skin"),
36 =welder::doc(R"(
37 An external model LOD view (.skin file), abstract over the client
38 version. Construct a concrete version with Skin.for_version(expansion);
39 the per-version Skin* classes are subclasses. See
40 https://wowdev.wiki/M2/.skin.)")
41 ]] SkinBase {
42 bool operator==(const SkinBase&) const = default;
43 };
44
49 @tparam V the client version this skin targets.
50 @see https://wowdev.wiki/M2/.skin */
51 namespace detail {
52 template <ClientVersion V> requires (V >= M2PerSequenceTimelines)
53 struct [[
54 =welder::weld,
55 =welder::doc(R"(
56 One external LOD view (.skin file, WotLK+): the 'SKIN' magic plus the
57 profile tables (local lookups, submeshes, render batches). See
58 https://wowdev.wiki/M2/.skin.)")
60 static constexpr ClientVersion Version = V;
61
62 [[=welder::mark::exclude,
63 =welder::doc("The leading magic, 'SKIN' — constant on every view file; "
64 "hidden from the bindings.")]]
65 std::uint32_t magic = SkinMagic;
66
67 [[=welder::doc("The LOD view's tables (local lookups, submeshes, "
68 "batches).")]]
69 skin::M2SkinProfile<V> profile{};
70
71 bool operator==(const Skin&) const = default;
72 };
73 }
74
79 template <ClientVersion V> requires (V >= M2PerSequenceTimelines)
80 using Skin = detail::Skin<canonicalVersion(V, M2SkinPivots, M2SkinVersions)>;
81}
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
Binding-language identities welder's core does not name.
#define WOWLIB_CS_FAMILY_SURFACE
The C# rod's family-surface opt-in, spellable in every build.
Definition lang.hpp:44
The M2 version vocabulary: the layout pivots record/entity partial specializations key on,...
M2 skin-profile records (namespace wowlib::formats::m2::skin): the LOD view onto the model — local ve...
One external LOD view of a model ("{model}0N.skin", or SFID FileDataIDs in Legion+).
Definition records.hpp:51
The external LOD view entity (.skin file, WotLK+) and the skin profile records (submeshes,...
Definition records.hpp:26
detail::Skin< canonicalVersion(V, M2SkinPivots, M2SkinVersions)> Skin
An external LOD view — the canonicalizing face of detail::Skin: every WotLK+ version maps to its rang...
Definition skin.hpp:67
constexpr std::uint32_t SkinMagic
The .skin leading magic, as memcpy'd from disk.
Definition skin.hpp:22
detail::M2SkinProfile< canonicalVersion(V, M2SkinProfilePivots, M2Versions)> M2SkinProfile
One LOD view — the canonicalizing face of detail::M2SkinProfile (M2SkinProfilePivots: TBC's section l...
Definition records.hpp:253
constexpr ClientVersion M2PerSequenceTimelines
WotLK (v264): every M2Track nests one timestamp/value array per sequence (the vanilla single timeline...
constexpr std::array M2SkinVersions
The era subset .skin files exist for (WotLK+).
constexpr std::array M2SkinPivots
The Skin entity (.skin files, WotLK+): its existence boundary plus the profile's Cata shadow batches.
constexpr ClientVersion canonicalVersion(ClientVersion v, std::span< const ClientVersion > pivots, std::span< const ClientVersion > grid)
The canonical version v collapses to: the FIRST grid version in v's range.
The offset-format storage vocabulary and serializer engine for the M2 family, in one header.
The serialization face of an offset block, mixed in CRTP-style: an entity struct E : M2OffsetBlock<E>...
The version-agnostic base of every Skin<V> (welded as "Skin").
Definition skin.hpp:37
bool operator==(const SkinBase &) const =default
bool operator==(const Skin &) const =default