CommonLibSSE NG
Loading...
Searching...
No Matches
TESObjectCELL.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSAtomic.h"
4#include "RE/B/BSBitField.h"
5#include "RE/B/BSContainer.h"
8#include "RE/B/BSTArray.h"
9#include "RE/B/BSTHashMap.h"
10#include "RE/B/BSTList.h"
11#include "RE/C/Color.h"
12#include "RE/E/ExtraDataList.h"
13#include "RE/F/FormTypes.h"
14#include "RE/I/InteriorData.h"
15#include "RE/N/NiSmartPointer.h"
16#include "RE/N/NiTMap.h"
17#include "RE/T/TESForm.h"
18#include "RE/T/TESFullName.h"
19#include "RE/T/TESObjectREFR.h"
20#include "SKSE/Version.h"
21
22namespace RE
23{
24 class TESRegionList;
25
26 namespace BGSWaterCollisionManager
27 {
28 class BGSWaterUpdateI;
29 }
30
32 class bhkWorld;
33 class BSPortalGraph;
34 class NavMesh;
35 class NiNode;
36
38 {
39 public:
40 // members
42 };
43 static_assert(sizeof(BGSTerrainVisibilityData) == 0x8);
44
45 struct EXTERIOR_DATA // XCLC
46 {
47 public:
48 enum class LandHideFlag
49 {
50 kNone = 0,
51 kQuad1 = 1 << 0,
52 kQuad2 = 1 << 1,
53 kQuad3 = 1 << 2,
54 kQuad4 = 1 << 3
55 };
56
57 // members
58 std::int32_t cellX; // 00
59 std::int32_t cellY; // 04
60 char* maxHeightData; // 08
62 float worldX; // 18
63 float worldY; // 1C
65 std::uint8_t pad21; // 21
66 std::uint16_t pad22; // 22
67 std::uint32_t pad24; // 24
68 };
69 static_assert(sizeof(EXTERIOR_DATA) == 0x28);
70
72 {
73 public:
74 // members
76 };
77 static_assert(sizeof(NavMeshArray) == 0x18);
78
80 {
81 public:
82 // members
85 void* unk010; // 010 - smart ptr
86 void* unk018; // 018 - smart ptr
87 void* unk020; // 020 - smart ptr
88 std::uint64_t unk028; // 028
89 std::uint64_t unk030; // 030
90 std::uint64_t unk038; // 038
99 std::uint64_t unk110; // 110
104 std::uint32_t unk168; // 168
105 volatile mutable std::int32_t criticalQueuedRefCount; // 16C
106 volatile mutable std::int32_t queuedRefCount; // 170
107 volatile mutable std::int32_t queuedDistantRefCount; // 174
108 std::uint32_t unk178; // 178
109 std::uint32_t unk17C; // 17C
110 };
111 static_assert(sizeof(LOADED_CELL_DATA) == 0x180);
112
114 public TESForm, // 000
115 public TESFullName // 020
116 {
117 public:
118 inline static constexpr auto RTTI = RTTI_TESObjectCELL;
119 inline static constexpr auto VTABLE = VTABLE_TESObjectCELL;
120 inline static constexpr auto FORMTYPE = FormType::Cell;
121
122 enum class Flag // DATA
123 {
124 kNone = 0,
125 kIsInteriorCell = 1 << 0,
126 kHasWater = 1 << 1,
127 kCanTravelFromHere = 1 << 2,
128 kNoLODWater = 1 << 3,
129 kHasTempData = 1 << 4,
130 kPublicArea = 1 << 5,
131 kHandChanged = 1 << 6,
132 kShowSky = 1 << 7,
133 kUseSkyLighting = 1 << 8,
134 kWarnToLeave = 1 << 9
135 };
136
137 enum class CellState
138 {
139 kAttached = 7
140 };
141
143 {
144 enum ChangeFlag : std::uint32_t
145 {
146 kFlags = 1 << 1,
147 kFullName = 1 << 2,
148 kOwnership = 1 << 3,
149 kExteriorShort = 1 << 28,
150 kExteriorChar = 1 << 29,
151 kDetachTime = 1 << 30,
152 kSeendData = (std::uint32_t)1 << 31
153 };
154 };
155
157 {
158 enum RecordFlag : std::uint32_t
159 {
160 kDeleted = 1 << 5,
161 kPersistent = 1 << 10,
162 kIgnored = 1 << 12,
163 kOffLimits = 1 << 17,
164 kCompressed = 1 << 18,
165 kCantWait = 1 << 19
166 };
167 };
168
170 {
173 };
174 static_assert(sizeof(CellData) == 0x8);
175
176 ~TESObjectCELL() override; // 00
177
178 // override (TESForm)
179 void ClearData() override; // 05
180 bool Load(TESFile* a_mod) override; // 06
181 TESForm* CreateDuplicateForm(bool a_createEditorID, void* a_arg2) override; // 09 - { return 0; }
182 bool FindInFileFast(TESFile* a_mod) override; // 0C
183 void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
184 void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
185 void Revert(BGSLoadFormBuffer* a_buf) override; // 12
186 void InitItemImpl() override; // 13
187 void GetFormDetailedString(char* a_buf, std::uint32_t a_bufLen) override; // 16
188 void SetAltered(bool a_set) override; // 24
189 bool BelongsInGroup(FORM* a_form, bool a_allowParentGroups, bool a_currentOnly) override; // 30
190 void CreateGroupData(FORM* a_form, FORM_GROUP* a_group) override; // 31
191 const char* GetFormEditorID() const override; // 32
192 bool SetFormEditorID(const char* a_str) override; // 33
193 [[nodiscard]] bool IsParentForm() override; // 34 - { return true; }
194 [[nodiscard]] bool IsFormTypeChild(FormType a_type) override; // 36
195
197
198 inline bhkWorld* GetbhkWorld() const
199 {
200 using func_t = decltype(&TESObjectCELL::GetbhkWorld);
201 REL::Relocation<func_t> func{ RELOCATION_ID(18536, 18995) };
202 return func(this);
203 }
204
205 void ForEachReference(std::function<BSContainer::ForEachResult(TESObjectREFR&)> a_callback) const;
206 void ForEachReferenceInRange(const NiPoint3& a_origin, float a_radius, std::function<BSContainer::ForEachResult(TESObjectREFR&)> a_callback) const;
208 [[nodiscard]] TESFaction* GetFactionOwner();
209 [[nodiscard]] INTERIOR_DATA* GetLighting();
210
211 [[nodiscard]] inline BGSLocation* GetLocation() const
212 {
213 using func_t = decltype(&TESObjectCELL::GetLocation);
214 REL::Relocation<func_t> func{ RELOCATION_ID(18474, 18905) };
215 return func(this);
216 }
217
218 [[nodiscard]] float GetNorthRotation();
219 [[nodiscard]] TESForm* GetOwner();
220 [[nodiscard]] float GetExteriorWaterHeight() const;
221 [[nodiscard]] TESRegionList* GetRegionList(bool a_createIfMissing);
222 bool GetWaterHeight(const NiPoint3& a_pos, float& a_waterHeight);
223 [[nodiscard]] bool IsAttached() const;
224 [[nodiscard]] bool IsExteriorCell() const;
225 [[nodiscard]] bool IsInteriorCell() const;
226 void SetActorOwner(TESNPC* a_owner);
228 void SetFogColor(Color a_near, Color a_far);
229 void SetFogPlanes(float a_near, float a_far);
230 void SetFogPower(float a_power);
231 void SetHandChanged(bool a_changed);
232 void SetOwner(TESForm* a_owner);
233 void SetPublic(bool a_public);
234 [[nodiscard]] bool UsesSkyLighting() const;
235
237 {
238#define RUNTIME_DATA_CONTENT \
239 CellData cellData; /* 060, 068 - XCLL if interior, XCLC if exterior */ \
240 TESObjectLAND* cellLand; /* 068, 070 */ \
241 float waterHeight; /* 070, 078 - XCLW */ \
242 NavMeshArray* navMeshes; /* 078, 080 */ \
243 BSTSet<NiPointer<TESObjectREFR>> references; /* 080, 088 */ \
244 TESForm* unk0B0; /* 0B0, 0B8 - REFR owner of cell? */ \
245 BSTArray<TESObjectREFR*> objectList; /* 0B8, 0C0 - persistent */ \
246 BSTArray<void*> unk0D0; /* 0D0, 0D8 */ \
247 BSTArray<BGSWaterCollisionManager::BGSWaterUpdateI*> waterObjects; /* 0E8, 0F0 */ \
248 BSTArray<void*> unk100; /* 100, 108 */ \
249 mutable BSSpinLock spinLock; /* 118, 120 */ \
250 TESWorldSpace* worldSpace; /* 120, 128 */ \
251 LOADED_CELL_DATA* loadedData; /* 128, 130 */ \
252 BGSLightingTemplate* lightingTemplate; /* 130, 138 - LTMP */ \
253 std::uint64_t unk138; /* 138, 140 */
254
256 };
257
258 [[nodiscard]] inline RUNTIME_DATA& GetRuntimeData() noexcept
259 {
260 return REL::RelocateMemberIfNewer<RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x60, 0x68);
261 }
262
263 [[nodiscard]] inline const RUNTIME_DATA& GetRuntimeData() const noexcept
264 {
265 return REL::RelocateMemberIfNewer<RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x60, 0x68);
266 }
267
268 // members
270 mutable BSSpinLock grassTaskLock; // 038
272 std::uint16_t cellGameFlags; // 042
274 bool autoWaterLoaded; // 045
275 bool cellDetached; // 046
276 std::uint8_t pad047; // 047
278
279#ifndef ENABLE_SKYRIM_AE
281#endif
282 };
283#ifndef ENABLE_SKYRIM_AE
284 static_assert(sizeof(TESObjectCELL) == 0x140);
285#endif
286}
287#undef RUNTIME_DATA
#define RUNTIME_DATA_CONTENT
Definition Actor.h:633
#define RELOCATION_ID(a_se, a_ae)
Definition PCH.h:794
Definition BGSEncounterZone.h:43
Definition BGSLoadFormBuffer.h:11
Definition BGSLocation.h:68
Definition TESObjectCELL.h:38
BSBitField * visData
Definition TESObjectCELL.h:41
Definition BSBitField.h:15
Definition BSPortalGraph.h:13
Definition BSTList.h:10
Definition BSAtomic.h:49
Definition BSTArray.h:377
Definition BSTempEffectParticle.h:19
Definition ExtraDataList.h:53
Definition TESObjectCELL.h:72
BSTArray< BSTSmartPointer< NavMesh > > navMeshes
Definition TESObjectCELL.h:75
Definition NavMesh.h:14
Definition NiNode.h:12
Definition NiPoint3.h:6
Definition NiSmartPointer.h:9
Definition NiTMap.h:10
Definition TESFaction.h:120
Definition TESFile.h:15
Definition TESForm.h:35
Definition TESFullName.h:9
Definition TESNPC.h:36
Definition TESObjectCELL.h:116
bool BelongsInGroup(FORM *a_form, bool a_allowParentGroups, bool a_currentOnly) override
bool IsExteriorCell() const
bool SetFormEditorID(const char *a_str) override
bool Load(TESFile *a_mod) override
void SetFogColor(Color a_near, Color a_far)
BGSLocation * GetLocation() const
Definition TESObjectCELL.h:211
void SetOwner(TESForm *a_owner)
EXTERIOR_DATA * GetCoordinates()
BSSpinLock grassCreateLock
Definition TESObjectCELL.h:269
float GetNorthRotation()
INTERIOR_DATA * GetLighting()
bool cellDetached
Definition TESObjectCELL.h:275
void ForEachReference(std::function< BSContainer::ForEachResult(TESObjectREFR &)> a_callback) const
void LoadGame(BGSLoadFormBuffer *a_buf) override
void SetFogPower(float a_power)
void SetAltered(bool a_set) override
std::uint8_t pad047
Definition TESObjectCELL.h:276
bool IsFormTypeChild(FormType a_type) override
const char * GetFormEditorID() const override
void SetHandChanged(bool a_changed)
bool IsParentForm() override
stl::enumeration< Flag, std::uint16_t > cellFlags
Definition TESObjectCELL.h:271
bool IsInteriorCell() const
CellState
Definition TESObjectCELL.h:138
void InitItemImpl() override
const RUNTIME_DATA & GetRuntimeData() const noexcept
Definition TESObjectCELL.h:263
BSSpinLock grassTaskLock
Definition TESObjectCELL.h:270
void ClearData() override
float GetExteriorWaterHeight() const
TESNPC * GetActorOwner()
TESForm * GetOwner()
TESRegionList * GetRegionList(bool a_createIfMissing)
void SetActorOwner(TESNPC *a_owner)
bool GetWaterHeight(const NiPoint3 &a_pos, float &a_waterHeight)
Flag
Definition TESObjectCELL.h:123
stl::enumeration< CellState, std::uint8_t > cellState
Definition TESObjectCELL.h:273
static constexpr auto RTTI
Definition TESObjectCELL.h:118
TESFaction * GetFactionOwner()
RUNTIME_DATA & GetRuntimeData() noexcept
Definition TESObjectCELL.h:258
static constexpr auto FORMTYPE
Definition TESObjectCELL.h:120
std::uint16_t cellGameFlags
Definition TESObjectCELL.h:272
bool IsAttached() const
void GetFormDetailedString(char *a_buf, std::uint32_t a_bufLen) override
void CreateGroupData(FORM *a_form, FORM_GROUP *a_group) override
~TESObjectCELL() override
void Revert(BGSLoadFormBuffer *a_buf) override
bhkWorld * GetbhkWorld() const
Definition TESObjectCELL.h:198
void SaveGame(BGSSaveFormBuffer *a_buf) override
void SetFactionOwner(TESFaction *a_owner)
bool autoWaterLoaded
Definition TESObjectCELL.h:274
void SetPublic(bool a_public)
bool FindInFileFast(TESFile *a_mod) override
void SetFogPlanes(float a_near, float a_far)
TESForm * CreateDuplicateForm(bool a_createEditorID, void *a_arg2) override
static constexpr auto VTABLE
Definition TESObjectCELL.h:119
bool UsesSkyLighting() const
void ForEachReferenceInRange(const NiPoint3 &a_origin, float a_radius, std::function< BSContainer::ForEachResult(TESObjectREFR &)> a_callback) const
ExtraDataList extraList
Definition TESObjectCELL.h:277
Definition TESObjectREFR.h:112
Definition TESRegionList.h:10
Definition bhkWorld.h:14
Definition Relocation.h:1638
Definition PCH.h:223
ForEachResult
Definition BSContainer.h:6
Definition AbsorbEffect.h:6
FormType
Definition FormTypes.h:139
constexpr REL::VariantID RTTI_TESObjectCELL(513892, 392430, 0x1ed95a0)
constexpr std::array< REL::VariantID, 2 > VTABLE_TESObjectCELL
Definition Offsets_VTABLE.h:619
constexpr REL::Version RUNTIME_SSE_1_6_629(1, 6, 629, 0)
Definition Color.h:8
Definition TESObjectCELL.h:46
std::int32_t cellY
Definition TESObjectCELL.h:59
BGSTerrainVisibilityData * lodVisData
Definition TESObjectCELL.h:61
std::uint32_t pad24
Definition TESObjectCELL.h:67
std::int32_t cellX
Definition TESObjectCELL.h:58
LandHideFlag
Definition TESObjectCELL.h:49
char * maxHeightData
Definition TESObjectCELL.h:60
float worldY
Definition TESObjectCELL.h:63
std::uint16_t pad22
Definition TESObjectCELL.h:66
std::uint8_t pad21
Definition TESObjectCELL.h:65
stl::enumeration< LandHideFlag, std::uint8_t > landHideFlags
Definition TESObjectCELL.h:64
float worldX
Definition TESObjectCELL.h:62
Definition FORM.h:20
Definition FORM.h:6
Definition InteriorData.h:9
Definition TESObjectCELL.h:80
BSTArray< void * > unk058
Definition TESObjectCELL.h:92
std::uint32_t unk17C
Definition TESObjectCELL.h:109
BSTArray< void * > unk040
Definition TESObjectCELL.h:91
NiTMap< ObjectRefHandle, NiNode * > emittanceLightRefMap
Definition TESObjectCELL.h:94
volatile std::int32_t queuedDistantRefCount
Definition TESObjectCELL.h:107
BSTArray< void * > unk130
Definition TESObjectCELL.h:101
std::uint64_t unk028
Definition TESObjectCELL.h:88
BSSimpleList< ObjectRefHandle > unk100
Definition TESObjectCELL.h:98
volatile std::int32_t queuedRefCount
Definition TESObjectCELL.h:106
NiTMap< ObjectRefHandle, NiPointer< BSMultiBoundNode > > multiboundRefMap
Definition TESObjectCELL.h:95
volatile std::int32_t criticalQueuedRefCount
Definition TESObjectCELL.h:105
std::uint64_t unk038
Definition TESObjectCELL.h:90
std::uint64_t unk030
Definition TESObjectCELL.h:89
BSTArray< void * > unk118
Definition TESObjectCELL.h:100
NiTMap< BSMultiBoundNode *, ObjectRefHandle > refMultiboundMap
Definition TESObjectCELL.h:96
NiPointer< BSPortalGraph > portalGraph
Definition TESObjectCELL.h:83
NiPointer< NiNode > cell3D
Definition TESObjectCELL.h:84
BGSEncounterZone * encounterZone
Definition TESObjectCELL.h:103
void * unk020
Definition TESObjectCELL.h:87
void * unk018
Definition TESObjectCELL.h:86
std::uint32_t unk178
Definition TESObjectCELL.h:108
BSSimpleList< ObjectRefHandle > activatingRefs
Definition TESObjectCELL.h:97
void * unk010
Definition TESObjectCELL.h:85
BSTArray< void * > unk148
Definition TESObjectCELL.h:102
NiTMap< TESForm *, ObjectRefHandle > unk070
Definition TESObjectCELL.h:93
std::uint64_t unk110
Definition TESObjectCELL.h:99
std::uint32_t unk168
Definition TESObjectCELL.h:104
Definition TESObjectCELL.h:143
ChangeFlag
Definition TESObjectCELL.h:145
@ kFullName
Definition TESObjectCELL.h:147
@ kExteriorShort
Definition TESObjectCELL.h:149
@ kSeendData
Definition TESObjectCELL.h:152
@ kFlags
Definition TESObjectCELL.h:146
@ kDetachTime
Definition TESObjectCELL.h:151
@ kExteriorChar
Definition TESObjectCELL.h:150
@ kOwnership
Definition TESObjectCELL.h:148
Definition TESObjectCELL.h:237
Definition TESObjectCELL.h:157
RecordFlag
Definition TESObjectCELL.h:159
@ kIgnored
Definition TESObjectCELL.h:162
@ kOffLimits
Definition TESObjectCELL.h:163
@ kPersistent
Definition TESObjectCELL.h:161
@ kCompressed
Definition TESObjectCELL.h:164
@ kDeleted
Definition TESObjectCELL.h:160
@ kCantWait
Definition TESObjectCELL.h:165
Definition TESObjectCELL.h:170
EXTERIOR_DATA * exterior
Definition TESObjectCELL.h:171
INTERIOR_DATA * interior
Definition TESObjectCELL.h:172