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