CommonLibSSE (Parapets fork)
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"
6 #include "RE/B/BSPointerHandle.h"
7 #include "RE/B/BSSimpleList.h"
8 #include "RE/B/BSTArray.h"
9 #include "RE/B/BSTHashMap.h"
10 #include "RE/C/Color.h"
11 #include "RE/E/ExtraDataList.h"
12 #include "RE/F/FormTypes.h"
13 #include "RE/I/InteriorData.h"
14 #include "RE/N/NiSmartPointer.h"
15 #include "RE/N/NiTMap.h"
16 #include "RE/T/TESForm.h"
17 #include "RE/T/TESFullName.h"
18 #include "RE/T/TESObjectREFR.h"
19 
20 namespace RE
21 {
22  class bhkWorld;
23  class NavMesh;
24  class NiNode;
25 
27  {
28  public:
29  // members
31  };
32  static_assert(sizeof(BGSTerrainVisibilityData) == 0x8);
33 
34  struct EXTERIOR_DATA // XCLC
35  {
36  public:
37  enum class LandHideFlag
38  {
39  kNone = 0,
40  kQuad1 = 1 << 0,
41  kQuad2 = 1 << 1,
42  kQuad3 = 1 << 2,
43  kQuad4 = 1 << 3
44  };
45 
46  // members
47  std::int32_t cellX; // 00
48  std::int32_t cellY; // 04
49  char* maxHeightData; // 08
51  float worldX; // 18
52  float worldY; // 1C
54  std::uint8_t pad21; // 21
55  std::uint16_t pad22; // 22
56  std::uint32_t pad24; // 24
57  };
58  static_assert(sizeof(EXTERIOR_DATA) == 0x28);
59 
61  {
62  public:
63  // members
65  };
66  static_assert(sizeof(NavMeshArray) == 0x18);
67 
69  {
70  public:
71  // members
72  void* unk000; // 000 - smart ptr
74  void* unk010; // 010 - smart ptr
75  void* unk018; // 018 - smart ptr
76  void* unk020; // 020 - smart ptr
77  std::uint64_t unk028; // 028
78  std::uint64_t unk030; // 030
79  std::uint64_t unk038; // 038
88  std::uint64_t unk110; // 110
93  std::uint64_t unk168; // 168
94  std::uint64_t unk170; // 170
95  std::uint64_t unk178; // 178
96  };
97  static_assert(sizeof(LOADED_CELL_DATA) == 0x180);
98 
99  class TESObjectCELL :
100  public TESForm, // 000
101  public TESFullName // 020
102  {
103  public:
104  inline static constexpr auto RTTI = RTTI_TESObjectCELL;
105  inline static constexpr auto FORMTYPE = FormType::Cell;
106 
107  enum class Flag // DATA
108  {
109  kNone = 0,
110  kIsInteriorCell = 1 << 0,
111  kHasWater = 1 << 1,
112  kCanTravelFromHere = 1 << 2,
113  kNoLODWater = 1 << 3,
114  kHasTempData = 1 << 4,
115  kPublicArea = 1 << 5,
116  kHandChanged = 1 << 6,
117  kShowSky = 1 << 7,
118  kUseSkyLighting = 1 << 8
119  };
120 
121  enum class CellState
122  {
123  kAttached = 7
124  };
125 
126  struct ChangeFlags
127  {
128  enum ChangeFlag : std::uint32_t
129  {
130  kFlags = 1 << 1,
131  kFullName = 1 << 2,
132  kOwnership = 1 << 3,
133  kExteriorShort = 1 << 28,
134  kExteriorChar = 1 << 29,
135  kDetachTime = 1 << 30,
136  kSeendData = (std::uint32_t)1 << 31
137  };
138  };
139 
140  struct RecordFlags
141  {
142  enum RecordFlag : std::uint32_t
143  {
144  kDeleted = 1 << 5,
145  kPersistent = 1 << 10,
146  kIgnored = 1 << 12,
147  kOffLimits = 1 << 17,
148  kCompressed = 1 << 18,
149  kCantWait = 1 << 19
150  };
151  };
152 
153  union CellData
154  {
157  };
158  static_assert(sizeof(CellData) == 0x8);
159 
160  ~TESObjectCELL() override; // 00
161 
162  // override (TESForm)
163  void ClearData() override; // 05
164  bool Load(TESFile* a_mod) override; // 06
165  TESForm* CreateDuplicateForm(bool a_createEditorID, void* a_arg2) override; // 09 - { return 0; }
166  bool FindInFileFast(TESFile* a_mod) override; // 0C
167  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
168  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
169  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
170  void InitItemImpl() override; // 13
171  void GetFormDetailedString(char* a_buf, std::uint32_t a_bufLen) override; // 16
172  void SetAltered(bool a_set) override; // 24
173  bool BelongsInGroup(FORM* a_form, bool a_allowParentGroups, bool a_currentOnly) override; // 30
174  void CreateGroupData(FORM* a_form, FORM_GROUP* a_group) override; // 31
175  const char* GetFormEditorID() const override; // 32
176  bool SetFormEditorID(const char* a_str) override; // 33
177  bool IsParentForm() override; // 34 - { return true; }
178  bool IsFormTypeChild(FormType a_type) override; // 36
179 
181 
182  [[nodiscard]] bhkWorld* GetbhkWorld() const;
183 
184  void ForEachReference(std::function<bool(TESObjectREFR&)> a_callback) const;
185  void ForEachReferenceInRange(const NiPoint3& a_origin, float a_radius, std::function<bool(TESObjectREFR&)> a_callback) const;
191  bool IsAttached() const;
192  bool IsExteriorCell() const;
193  bool IsInteriorCell() const;
194  void SetActorOwner(TESNPC* a_owner);
195  void SetFactionOwner(TESFaction* a_owner);
196  void SetFogColor(Color a_near, Color a_far);
197  void SetFogPlanes(float a_near, float a_far);
198  void SetFogPower(float a_power);
199  void SetHandChanged(bool a_changed);
200  void SetOwner(TESForm* a_owner);
201  void SetPublic(bool a_public);
202  bool UsesSkyLighting() const;
203 
204  // members
205  mutable BSSpinLock grassCreateLock; // 030
206  mutable BSSpinLock grassTaskLock; // 038
208  std::uint16_t cellGameFlags; // 042
210  bool autoWaterLoaded; // 045
211  bool cellDetached; // 046
212  std::uint8_t pad047; // 047
214  CellData cellData; // 060 - XCLL if interior, XCLC if exterior
216  float waterHeight; // 070 - XCLW
219  TESForm* unk0B0; // 0B0 - REFR owner of cell?
224  mutable BSSpinLock spinLock; // 118
228  std::uint64_t unk138; // 138
229  };
230 #if !defined(SKYRIMVR) && !defined(SKYRIMSE_PRE_1_6_629)
231  static_assert(sizeof(TESObjectCELL) == 0x148);
232 #else
233  static_assert(sizeof(TESObjectCELL) == 0x140);
234 #endif
235 }
Definition: BGSEncounterZone.h:43
Definition: BGSLightingTemplate.h:11
Definition: TESObjectCELL.h:27
BSBitField * visData
Definition: TESObjectCELL.h:30
Definition: BSBitField.h:15
Definition: BSSimpleList.h:10
Definition: BSAtomic.h:49
Definition: BSTArray.h:377
Definition: BSTHashMap.h:21
Definition: ExtraDataList.h:50
Definition: TESObjectCELL.h:61
BSTArray< BSTSmartPointer< NavMesh > > navMeshes
Definition: TESObjectCELL.h:64
Definition: NiPoint3.h:6
Definition: NiSmartPointer.h:9
Definition: NiTMap.h:10
Definition: TESFaction.h:120
Definition: TESFile.h:14
Definition: TESForm.h:34
Definition: TESFullName.h:9
Definition: TESNPC.h:36
Definition: TESObjectCELL.h:102
bool BelongsInGroup(FORM *a_form, bool a_allowParentGroups, bool a_currentOnly) override
BGSLightingTemplate * lightingTemplate
Definition: TESObjectCELL.h:227
bool IsExteriorCell() const
bool SetFormEditorID(const char *a_str) override
bool Load(TESFile *a_mod) override
void SetFogColor(Color a_near, Color a_far)
void ForEachReference(std::function< bool(TESObjectREFR &)> a_callback) const
CellData cellData
Definition: TESObjectCELL.h:214
void SetOwner(TESForm *a_owner)
TESWorldSpace * worldSpace
Definition: TESObjectCELL.h:225
BSSpinLock grassCreateLock
Definition: TESObjectCELL.h:205
float GetNorthRotation()
TESForm * unk0B0
Definition: TESObjectCELL.h:219
bool cellDetached
Definition: TESObjectCELL.h:211
void LoadGame(BGSLoadFormBuffer *a_buf) override
void SetFogPower(float a_power)
void SetAltered(bool a_set) override
std::uint8_t pad047
Definition: TESObjectCELL.h:212
bool IsFormTypeChild(FormType a_type) override
TESForm * CreateDuplicateForm(bool a_createEditorID, void *a_arg2) override
TESForm * GetOwner()
void SetHandChanged(bool a_changed)
TESFaction * GetFactionOwner()
bool IsParentForm() override
stl::enumeration< Flag, std::uint16_t > cellFlags
Definition: TESObjectCELL.h:207
bool IsInteriorCell() const
CellState
Definition: TESObjectCELL.h:122
void InitItemImpl() override
std::uint64_t unk138
Definition: TESObjectCELL.h:228
NavMeshArray * navMeshes
Definition: TESObjectCELL.h:217
BSTSet< NiPointer< TESObjectREFR > > references
Definition: TESObjectCELL.h:218
BSSpinLock grassTaskLock
Definition: TESObjectCELL.h:206
void ClearData() override
BSSpinLock spinLock
Definition: TESObjectCELL.h:224
bhkWorld * GetbhkWorld() const
void SetActorOwner(TESNPC *a_owner)
INTERIOR_DATA * GetLighting()
Flag
Definition: TESObjectCELL.h:108
stl::enumeration< CellState, std::uint8_t > cellState
Definition: TESObjectCELL.h:209
LOADED_CELL_DATA * loadedData
Definition: TESObjectCELL.h:226
static constexpr auto RTTI
Definition: TESObjectCELL.h:104
BSTArray< void * > unk0D0
Definition: TESObjectCELL.h:221
static constexpr auto FORMTYPE
Definition: TESObjectCELL.h:105
TESNPC * GetActorOwner()
void ForEachReferenceInRange(const NiPoint3 &a_origin, float a_radius, std::function< bool(TESObjectREFR &)> a_callback) const
std::uint16_t cellGameFlags
Definition: TESObjectCELL.h:208
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
EXTERIOR_DATA * GetCoordinates()
void SaveGame(BGSSaveFormBuffer *a_buf) override
void SetFactionOwner(TESFaction *a_owner)
bool autoWaterLoaded
Definition: TESObjectCELL.h:210
BSTArray< TESObjectREFR * > objectList
Definition: TESObjectCELL.h:220
void SetPublic(bool a_public)
float waterHeight
Definition: TESObjectCELL.h:216
BSTArray< void * > unk0E8
Definition: TESObjectCELL.h:222
bool FindInFileFast(TESFile *a_mod) override
void SetFogPlanes(float a_near, float a_far)
TESObjectLAND * cellLand
Definition: TESObjectCELL.h:215
bool UsesSkyLighting() const
const char * GetFormEditorID() const override
BSTArray< void * > unk100
Definition: TESObjectCELL.h:223
ExtraDataList extraList
Definition: TESObjectCELL.h:213
Definition: TESObjectLAND.h:46
Definition: TESObjectREFR.h:105
Definition: TESWorldSpace.h:116
Definition: bhkWorld.h:8
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESObjectCELL
Definition: Offsets_RTTI.h:6032
FormType
Definition: FormTypes.h:139
Definition: Color.h:6
Definition: TESObjectCELL.h:35
std::int32_t cellY
Definition: TESObjectCELL.h:48
BGSTerrainVisibilityData * lodVisData
Definition: TESObjectCELL.h:50
std::uint32_t pad24
Definition: TESObjectCELL.h:56
std::int32_t cellX
Definition: TESObjectCELL.h:47
LandHideFlag
Definition: TESObjectCELL.h:38
char * maxHeightData
Definition: TESObjectCELL.h:49
float worldY
Definition: TESObjectCELL.h:52
std::uint16_t pad22
Definition: TESObjectCELL.h:55
std::uint8_t pad21
Definition: TESObjectCELL.h:54
stl::enumeration< LandHideFlag, std::uint8_t > landHideFlags
Definition: TESObjectCELL.h:53
float worldX
Definition: TESObjectCELL.h:51
Definition: FORM.h:20
Definition: FORM.h:6
Definition: InteriorData.h:9
Definition: TESObjectCELL.h:69
BSTArray< void * > unk058
Definition: TESObjectCELL.h:81
BSTArray< void * > unk040
Definition: TESObjectCELL.h:80
NiTMap< ObjectRefHandle, NiNode * > emittanceLightRefMap
Definition: TESObjectCELL.h:83
BSTArray< void * > unk130
Definition: TESObjectCELL.h:90
std::uint64_t unk028
Definition: TESObjectCELL.h:77
BSSimpleList< ObjectRefHandle > unk100
Definition: TESObjectCELL.h:87
NiTMap< ObjectRefHandle, NiPointer< BSMultiBoundNode > > multiboundRefMap
Definition: TESObjectCELL.h:84
void * unk000
Definition: TESObjectCELL.h:72
std::uint64_t unk038
Definition: TESObjectCELL.h:79
std::uint64_t unk030
Definition: TESObjectCELL.h:78
std::uint64_t unk168
Definition: TESObjectCELL.h:93
BSTArray< void * > unk118
Definition: TESObjectCELL.h:89
NiTMap< BSMultiBoundNode *, ObjectRefHandle > refMultiboundMap
Definition: TESObjectCELL.h:85
NiPointer< NiNode > cell3D
Definition: TESObjectCELL.h:73
BGSEncounterZone * encounterZone
Definition: TESObjectCELL.h:92
void * unk020
Definition: TESObjectCELL.h:76
std::uint64_t unk178
Definition: TESObjectCELL.h:95
std::uint64_t unk170
Definition: TESObjectCELL.h:94
void * unk018
Definition: TESObjectCELL.h:75
BSSimpleList< ObjectRefHandle > activatingRefs
Definition: TESObjectCELL.h:86
void * unk010
Definition: TESObjectCELL.h:74
BSTArray< void * > unk148
Definition: TESObjectCELL.h:91
NiTMap< TESForm *, ObjectRefHandle > unk070
Definition: TESObjectCELL.h:82
std::uint64_t unk110
Definition: TESObjectCELL.h:88
Definition: TESObjectCELL.h:127
ChangeFlag
Definition: TESObjectCELL.h:129
@ kFullName
Definition: TESObjectCELL.h:131
@ kExteriorShort
Definition: TESObjectCELL.h:133
@ kSeendData
Definition: TESObjectCELL.h:136
@ kFlags
Definition: TESObjectCELL.h:130
@ kDetachTime
Definition: TESObjectCELL.h:135
@ kExteriorChar
Definition: TESObjectCELL.h:134
@ kOwnership
Definition: TESObjectCELL.h:132
Definition: TESObjectCELL.h:141
RecordFlag
Definition: TESObjectCELL.h:143
@ kIgnored
Definition: TESObjectCELL.h:146
@ kOffLimits
Definition: TESObjectCELL.h:147
@ kPersistent
Definition: TESObjectCELL.h:145
@ kCompressed
Definition: TESObjectCELL.h:148
@ kDeleted
Definition: TESObjectCELL.h:144
@ kCantWait
Definition: TESObjectCELL.h:149
Definition: TESObjectCELL.h:154
EXTERIOR_DATA * exterior
Definition: TESObjectCELL.h:155
INTERIOR_DATA * interior
Definition: TESObjectCELL.h:156