CommonLibSSE NG
BSDismemberSkinInstance.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiSkinInstance.h"
4 
5 namespace RE
6 {
8  {
9  public:
10  inline static constexpr auto RTTI = RTTI_BSDismemberSkinInstance;
12 
13  struct Data
14  {
15  public:
16  // members
17  bool editorVisible; // 0
18  bool startNetBoneSet; // 1
19  std::uint16_t slot; // 2 - https://wiki.nexusmods.com/index.php/Skyrim_bodyparts_number
20  };
21  static_assert(sizeof(Data) == 0x4);
22 
23  struct RUNTIME_DATA
24  {
25 #define RUNTIME_DATA_CONTENT \
26  std::int32_t numPartitions; /* 00 */ \
27  std::uint32_t pad8C; /* 04 */ \
28  Data* partitions; /* 08 */ \
29  bool unk98; /* 10 */ \
30  std::uint8_t pad99; /* 11 */ \
31  std::uint16_t pad9A; /* 12 */ \
32  std::uint32_t pad9C; /* 14 */
33 
35  };
36  static_assert(sizeof(RUNTIME_DATA) == 0x18);
37 
38  ~BSDismemberSkinInstance() override; // 00
39 
40  // override (NiSkinInstance)
41  const NiRTTI* GetRTTI() const override; // 02
42  NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17
43  void LoadBinary(NiStream& a_stream) override; // 18
44  void LinkObject(NiStream& a_stream) override; // 19 - { NiSkinInstance::LinkObject(a_stream); }
45  bool RegisterStreamables(NiStream& a_stream) override; // 1A - { return NiSkinInstance::RegisterStreamables(a_stream) != false; }
46  void SaveBinary(NiStream& a_stream) override; // 1B
47  bool IsEqual(NiObject* a_object) override; // 1C
48  void Unk_25(void) override; // 25
49 
50  void UpdateDismemberPartion(std::uint16_t a_slot, bool a_enable)
51  {
52  using func_t = decltype(&BSDismemberSkinInstance::UpdateDismemberPartion);
53  REL::Relocation<func_t> func{ RELOCATION_ID(15576, 15753) };
54  return func(this, a_slot, a_enable);
55  }
56 
57  [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
58  {
59  return REL::RelocateMember<RUNTIME_DATA>(this, 0x88, 0x68);
60  }
61 
62  [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
63  {
64  return REL::RelocateMember<RUNTIME_DATA>(this, 0x88, 0x68);
65  }
66 
67  // members
68 #ifndef SKYRIM_CROSS_VR
69  RUNTIME_DATA_CONTENT // 88, 68
70 #endif
71  };
72 #ifndef ENABLE_SKYRIM_VR
73  static_assert(sizeof(BSDismemberSkinInstance) == 0xA0);
74 #elif !defined(ENABLE_SKYRIM_AE) && !defined(ENABLE_SKYRIM_SE)
75  static_assert(sizeof(BSDismemberSkinInstance) == 0x80);
76 #endif
77 }
78 #undef RUNTIME_DATA_CONTENT
#define RUNTIME_DATA_CONTENT
Definition: BSDismemberSkinInstance.h:25
#define RELOCATION_ID(a_se, a_ae)
Definition: PCH.h:724
Definition: Relocation.h:204
Definition: BSDismemberSkinInstance.h:8
void Unk_25(void) override
void SaveBinary(NiStream &a_stream) override
static auto Ni_RTTI
Definition: BSDismemberSkinInstance.h:11
bool IsEqual(NiObject *a_object) override
void LoadBinary(NiStream &a_stream) override
NiObject * CreateClone(NiCloningProcess &a_cloning) override
void LinkObject(NiStream &a_stream) override
static constexpr auto RTTI
Definition: BSDismemberSkinInstance.h:10
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition: BSDismemberSkinInstance.h:62
void UpdateDismemberPartion(std::uint16_t a_slot, bool a_enable)
Definition: BSDismemberSkinInstance.h:50
RUNTIME_DATA & GetRuntimeData() noexcept
Definition: BSDismemberSkinInstance.h:57
const NiRTTI * GetRTTI() const override
bool RegisterStreamables(NiStream &a_stream) override
Definition: NiCloningProcess.h:10
Definition: NiObject.h:37
Definition: NiRTTI.h:6
Definition: NiSkinInstance.h:16
Definition: NiStream.h:29
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_BSDismemberSkinInstance(690430, 398285, 0x1f61fa0)
constexpr REL::VariantID NiRTTI_BSDismemberSkinInstance(523941, 410521, 0x316be60)
Definition: BSDismemberSkinInstance.h:14
bool editorVisible
Definition: BSDismemberSkinInstance.h:17
std::uint16_t slot
Definition: BSDismemberSkinInstance.h:19
bool startNetBoneSet
Definition: BSDismemberSkinInstance.h:18
Definition: BSDismemberSkinInstance.h:24