CommonLibSSE (powerof3)
TES.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSContainer.h"
4 #include "RE/B/BSTEvent.h"
5 #include "RE/B/BSTList.h"
6 #include "RE/B/BSTTuple.h"
8 #include "RE/M/MaterialIDs.h"
9 #include "RE/N/NiPoint3.h"
10 #include "RE/N/NiSmartPointer.h"
11 
12 namespace RE
13 {
14  namespace BSResource
15  {
16  struct ArchiveStreamOpenedEvent;
17  }
18 
19  class BSSystemEvent;
20  class BSTempNodeManager;
21  class GridCellArray;
22  class ImageSpaceModifierInstance;
23  class NavMeshInfoMap;
24  class NiAVObject;
25  class NiNode;
26  class Sky;
27  class TESLandTexture;
28  class TESNPC;
29  class TESObjectCELL;
30  class TESObjectREFR;
31  class TESWorldSpace;
32 
33  struct bhkPickData;
34  struct PositionPlayerEvent;
35 
36  class TES :
37  public ICellAttachDetachEventSource, // 000
38  public BSTEventSink<BSResource::ArchiveStreamOpenedEvent>, // 060
39  public BSTEventSink<PositionPlayerEvent> // 068
40  {
41  public:
42  inline static constexpr auto RTTI = RTTI_TES;
43  inline static constexpr auto VTABLE = VTABLE_TES;
44 
45  class SystemEventAdapter : public BSTEventSink<BSSystemEvent>
46  {
47  public:
48  inline static constexpr auto RTTI = RTTI_TES;
49  inline static constexpr auto VTABLE = VTABLE_TES;
50 
51  ~SystemEventAdapter() override; // 00
52 
53  // override (BSTEventSink<BSSystemEvent>)
54  BSEventNotifyControl ProcessEvent(const BSSystemEvent* a_event, BSTEventSource<BSSystemEvent>* a_eventSource) override; // 01
55 
56  // members
57  std::uint64_t unk08; // 08
58  };
59  static_assert(sizeof(SystemEventAdapter) == 0x10);
60 
61  ~TES() override; // 00
62 
63  // override (BSTEventSink<BSResource::ArchiveStreamOpenedEvent>)
64  BSEventNotifyControl ProcessEvent(const BSResource::ArchiveStreamOpenedEvent* a_event, BSTEventSource<BSResource::ArchiveStreamOpenedEvent>* a_eventSource) override; // 01 - { return BSEventNotifyControl::kContinue; }
65 
66  // override (BSTEventSink<PositionPlayerEvent>)
68 
69  static TES* GetSingleton();
70 
71  void ForEachReference(std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback);
72  void ForEachReferenceInRange(TESObjectREFR* a_origin, float a_radius, std::function<BSContainer::ForEachResult(TESObjectREFR*)> a_callback);
73 
74  TESObjectCELL* GetCell(const NiPoint3& a_position) const;
75  MATERIAL_ID GetLandMaterialType(const NiPoint3& a_position) const;
76  bool GetLandHeight(const NiPoint3& a_positionIn, float& a_heightOut);
77  TESLandTexture* GetLandTexture(const NiPoint3& a_position) const;
78  float GetWaterHeight(const NiPoint3& a_pos, TESObjectCELL* a_cell) const;
79  NiAVObject* Pick(bhkPickData& a_pickData);
81 
82  // members
83  std::uint64_t unk070; // 070
85  NiNode* objRoot; // 080
88  BSTempNodeManager* tempNodeManager; // 098
89  std::uint64_t unk0A0; // 0A0
90  std::uint64_t unk0A8; // 0A8
91  std::uint32_t unk0B0; // 0B0
92  std::uint32_t unk0B4; // 0B4
93  std::uint64_t unk0B8; // 0B8
97  std::uint64_t unk0D8; // 0D8
98  std::uint64_t unk0E0; // 0E0
99  std::uint64_t unk0E8; // 0E8
100  std::uint64_t unk0F0; // 0F0
101  std::uint64_t unk0F8; // 0F8
102  Sky* sky; // 100
104  std::uint64_t unk118; // 118
105  std::uint64_t unk120; // 120
106 #ifdef SKYRIM_SUPPORT_AE
107  std::uint32_t unk128; // 128
108  std::uint32_t landBorderMode; // 12C
109  std::uint32_t borderColorAGBR; // 130
110 #else
111  std::uint8_t unk128; // 128
112  bool showLANDborders; // 129
113  std::uint8_t unk12A; // 12A
114  std::uint8_t unk12B; // 12B
115  std::uint8_t unk12C; // 12C
116  std::uint8_t unk12D; // 12D
117  std::uint8_t unk12E; // 12E
118  std::uint8_t unk12F; // 12F
119  std::uint16_t unk130; // 130
120  std::uint8_t unk132; // 132
121  std::uint8_t unk133; // 133
122 #endif
123  std::uint32_t unk134; // 134
124  std::uint64_t unk138; // 138
125 #ifdef SKYRIM_SUPPORT_AE
126  std::uint64_t unk140; // 140 - actual offset change is somewhere near showLandBorder
127 #endif
130  void* unk158; // 158 - smart ptr
131  void* unk160; // 160 - smart ptr
132  void* unk168; // 168 - smart ptr
133  void* unk170; // 170 - smart ptr
134  std::uint64_t unk178; // 178
135  std::uint64_t unk180; // 180
136  std::uint64_t unk188; // 188
137  std::uint64_t unk190; // 190
138  std::uint64_t unk198; // 198
139  std::uint64_t unk1A0; // 1A0
140  std::uint64_t unk1A8; // 1A8
141  std::uint64_t unk1B0; // 1B0
142  std::uint64_t unk1B8; // 1B8
143  std::uint64_t unk1C0; // 1C0
144  std::uint64_t unk1C8; // 1C8
145  std::uint64_t unk1D0; // 1D0
146  std::uint64_t unk1D8; // 1D8
147  std::uint64_t unk1E0; // 1E0
148  std::uint64_t unk1E8; // 1E8
149  std::uint64_t unk1F0; // 1F0
150  std::uint64_t unk1F8; // 1F8
151  std::uint64_t unk200; // 200
152  std::uint64_t unk208; // 208
153  std::uint64_t unk210; // 210
154  std::uint64_t unk218; // 218
155  std::uint64_t unk220; // 220
156  std::uint64_t unk228; // 228
157  std::uint64_t unk230; // 230
158  std::uint64_t unk238; // 238
159  std::uint64_t unk240; // 240
160  std::uint64_t unk248; // 248
161  std::uint64_t unk250; // 250
162  std::uint64_t unk258; // 258
163  std::uint64_t unk260; // 260
164  std::uint64_t unk268; // 268
165  std::uint64_t unk270; // 270
166  std::uint64_t unk278; // 278
167  std::uint64_t unk280; // 280
168  std::uint64_t unk288; // 288
170  std::uint64_t unk2A0; // 2A0
172  std::uint64_t unk2B0; // 2B0
173  };
174 #ifdef SKYRIM_SUPPORT_AE
175  static_assert(sizeof(TES) == 0x2C0);
176 #else
177  static_assert(sizeof(TES) == 0x2B8);
178 #endif
179 }
Definition: BSTList.h:10
Definition: BSTEvent.h:143
Definition: BSTEvent.h:19
Definition: GridCellArray.h:11
Definition: ICellAttachDetachEventSource.h:13
Definition: NavMeshInfoMap.h:19
Definition: NiAVObject.h:51
Definition: NiNode.h:12
Definition: NiPoint3.h:6
Definition: Sky.h:32
Definition: TESLandTexture.h:17
Definition: TESObjectCELL.h:115
Definition: TESObjectREFR.h:114
Definition: TESWorldSpace.h:118
Definition: TES.h:46
static constexpr auto RTTI
Definition: TES.h:48
std::uint64_t unk08
Definition: TES.h:57
BSEventNotifyControl ProcessEvent(const BSSystemEvent *a_event, BSTEventSource< BSSystemEvent > *a_eventSource) override
static constexpr auto VTABLE
Definition: TES.h:49
Definition: TES.h:40
void * unk158
Definition: TES.h:130
std::uint64_t unk1B8
Definition: TES.h:142
std::uint64_t unk208
Definition: TES.h:152
std::uint64_t unk118
Definition: TES.h:104
SystemEventAdapter unk290
Definition: TES.h:169
std::uint64_t unk0A0
Definition: TES.h:89
std::uint8_t unk132
Definition: TES.h:120
std::uint8_t unk12B
Definition: TES.h:114
BSSimpleList< NiPointer< ImageSpaceModifierInstance > > activeImageSpaceModifiers
Definition: TES.h:103
void * unk170
Definition: TES.h:133
std::uint32_t unk0B4
Definition: TES.h:92
std::uint64_t unk250
Definition: TES.h:161
bool showLANDborders
Definition: TES.h:112
BSSimpleList< BSTTuple< TESNPC *, std::uint16_t > * > deadCount
Definition: TES.h:129
std::uint64_t unk278
Definition: TES.h:166
std::uint64_t unk288
Definition: TES.h:168
bool GetLandHeight(const NiPoint3 &a_positionIn, float &a_heightOut)
void * unk160
Definition: TES.h:131
std::uint64_t unk1E0
Definition: TES.h:147
std::uint64_t unk0F8
Definition: TES.h:101
TESWorldSpace * worldSpace
Definition: TES.h:128
std::uint8_t unk12D
Definition: TES.h:116
static constexpr auto RTTI
Definition: TES.h:42
std::uint8_t unk133
Definition: TES.h:121
void * unk168
Definition: TES.h:132
std::uint64_t unk280
Definition: TES.h:167
std::uint64_t unk200
Definition: TES.h:151
Sky * sky
Definition: TES.h:102
std::uint64_t unk1C8
Definition: TES.h:144
MATERIAL_ID GetLandMaterialType(const NiPoint3 &a_position) const
std::uint64_t unk260
Definition: TES.h:163
NavMeshInfoMap * unk2A8
Definition: TES.h:171
std::uint64_t unk240
Definition: TES.h:159
std::uint32_t unk134
Definition: TES.h:123
std::uint64_t unk210
Definition: TES.h:153
std::uint64_t unk188
Definition: TES.h:136
void ForEachReference(std::function< BSContainer::ForEachResult(TESObjectREFR *)> a_callback)
std::uint64_t unk178
Definition: TES.h:134
NiNode * objRoot
Definition: TES.h:85
std::uint64_t unk180
Definition: TES.h:135
std::uint64_t unk218
Definition: TES.h:154
std::uint64_t unk0E0
Definition: TES.h:98
std::uint64_t unk270
Definition: TES.h:165
void PurgeBufferedCells()
std::uint64_t unk1F8
Definition: TES.h:150
std::uint64_t unk2A0
Definition: TES.h:170
GridCellArray * gridCells
Definition: TES.h:84
std::uint8_t unk12F
Definition: TES.h:118
std::uint64_t unk1D0
Definition: TES.h:145
std::uint64_t unk1A0
Definition: TES.h:139
std::uint64_t unk198
Definition: TES.h:138
std::uint64_t unk0D8
Definition: TES.h:97
TESObjectCELL * GetCell(const NiPoint3 &a_position) const
TESLandTexture * GetLandTexture(const NiPoint3 &a_position) const
BSTempNodeManager * tempNodeManager
Definition: TES.h:88
std::uint64_t unk0F0
Definition: TES.h:100
std::uint64_t unk1F0
Definition: TES.h:149
std::uint64_t unk1D8
Definition: TES.h:146
NiNode * objLODWaterRoot
Definition: TES.h:87
std::uint64_t unk1A8
Definition: TES.h:140
std::uint8_t unk12A
Definition: TES.h:113
BSEventNotifyControl ProcessEvent(const BSResource::ArchiveStreamOpenedEvent *a_event, BSTEventSource< BSResource::ArchiveStreamOpenedEvent > *a_eventSource) override
static TES * GetSingleton()
NiAVObject * Pick(bhkPickData &a_pickData)
std::uint64_t unk248
Definition: TES.h:160
std::uint64_t unk220
Definition: TES.h:155
std::uint64_t unk190
Definition: TES.h:137
std::uint64_t unk238
Definition: TES.h:158
std::uint64_t unk138
Definition: TES.h:124
BSEventNotifyControl ProcessEvent(const PositionPlayerEvent *a_event, BSTEventSource< PositionPlayerEvent > *a_eventSource) override
std::uint64_t unk1B0
Definition: TES.h:141
static constexpr auto VTABLE
Definition: TES.h:43
std::uint64_t unk268
Definition: TES.h:164
std::uint64_t unk230
Definition: TES.h:157
std::uint8_t unk12C
Definition: TES.h:115
float GetWaterHeight(const NiPoint3 &a_pos, TESObjectCELL *a_cell) const
std::uint64_t unk2B0
Definition: TES.h:172
TESObjectCELL * interiorCell
Definition: TES.h:94
std::uint64_t unk0E8
Definition: TES.h:99
std::uint32_t unk0B0
Definition: TES.h:91
std::uint8_t unk12E
Definition: TES.h:117
TESObjectCELL ** interiorBuffer
Definition: TES.h:95
std::uint64_t unk0A8
Definition: TES.h:90
std::uint64_t unk070
Definition: TES.h:83
std::uint64_t unk120
Definition: TES.h:105
std::uint64_t unk0B8
Definition: TES.h:93
void ForEachReferenceInRange(TESObjectREFR *a_origin, float a_radius, std::function< BSContainer::ForEachResult(TESObjectREFR *)> a_callback)
std::uint16_t unk130
Definition: TES.h:119
NiNode * lodLandRoot
Definition: TES.h:86
~TES() override
TESObjectCELL ** exteriorBuffer
Definition: TES.h:96
std::uint64_t unk1E8
Definition: TES.h:148
std::uint8_t unk128
Definition: TES.h:111
std::uint64_t unk1C0
Definition: TES.h:143
std::uint64_t unk228
Definition: TES.h:156
std::uint64_t unk258
Definition: TES.h:162
ForEachResult
Definition: BSContainer.h:6
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 3 > VTABLE_TES
Definition: Offsets_VTABLE.h:12796
MATERIAL_ID
Definition: MaterialIDs.h:6
constexpr REL::ID RTTI_TES(static_cast< std::uint64_t >(684836))
BSEventNotifyControl
Definition: BSTEvent.h:12
Definition: PositionPlayerEvent.h:7
Definition: bhkPickData.h:11