CommonLibSSE (Parapets fork)
TESObjectLIGH.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSEquipType.h"
5 #include "RE/B/BGSMessageIcon.h"
6 #include "RE/C/Color.h"
7 #include "RE/F/FormTypes.h"
8 #include "RE/N/NiColor.h"
10 #include "RE/T/TESFullName.h"
11 #include "RE/T/TESIcon.h"
13 #include "RE/T/TESValueForm.h"
14 #include "RE/T/TESWeightForm.h"
15 
16 namespace RE
17 {
18  enum class TES_LIGHT_FLAGS
19  {
20  kNone = 0,
21  kDynamic = 1 << 0,
22  kCanCarry = 1 << 1,
23  kNegative = 1 << 2,
24  kFlicker = 1 << 3,
25  kDeepCopy = 1 << 4,
26  kOffByDefault = 1 << 5,
27  kFlickerSlow = 1 << 6,
28  kPulse = 1 << 7,
29  kPulseSlow = 1 << 8,
30  kSpotlight = 1 << 9,
31  kSpotShadow = 1 << 10,
32  kHemiShadow = 1 << 11,
33  kOmniShadow = 1 << 12,
34  kPortalStrict = 1 << 13
35  };
36 
37  struct OBJ_LIGH // DATA
38  {
39  public:
40  // members
41  std::int32_t time; // 00
42  std::uint32_t radius; // 04
43  Color color; // 08
45  float fallofExponent; // 10
46  float fov; // 14
47  float nearDistance; // 18
48  float flickerPeriodRecip; // 1C - CK value * 100
51  };
52  static_assert(sizeof(OBJ_LIGH) == 0x28);
53 
54  class TESObjectLIGH :
55  public TESBoundAnimObject, // 000
56  public TESFullName, // 030
57  public TESModelTextureSwap, // 040
58  public TESIcon, // 078
59  public BGSMessageIcon, // 088
60  public TESWeightForm, // 0A0
61  public TESValueForm, // 0B0
62  public BGSDestructibleObjectForm, // 0C0
63  public BGSEquipType // 0D0
64  {
65  public:
66  inline static constexpr auto RTTI = RTTI_TESObjectLIGH;
67  inline static constexpr auto FORMTYPE = FormType::Light;
68 
69  struct RecordFlags
70  {
71  enum RecordFlag : std::uint32_t
72  {
73  kDeleted = 1 << 5,
74  kIgnored = 1 << 12,
75  kRandomAnimStart = 1 << 16,
76  kPortalStrict = 1 << 17,
77  kObstacle = 1 << 25
78  };
79  };
80 
81  ~TESObjectLIGH() override; // 00
82 
83  // override (TESBoundAnimObject)
84  void InitializeData() override; // 04
85  bool Load(TESFile* a_mod) override; // 06
86  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
87  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
88  void InitItemImpl() override; // 13
89  bool Activate(TESObjectREFR* a_targetRef, TESObjectREFR* a_activatorRef, std::uint8_t a_arg3, TESBoundObject* a_object, std::int32_t a_targetCount) override; // 37
90  void UnClone3D(TESObjectREFR* a_ref) override; // 41
91  NiAVObject* LoadGraphics(TESObjectREFR* a_ref) override; // 47
92  NiAVObject* Clone3D(TESObjectREFR* a_ref) override; // 4A
93 
94  // override (BGSEquipType)
95  BGSEquipSlot* GetEquipSlot() const override; // 04
96  void SetEquipSlot(BGSEquipSlot* a_slot) override; // 05 - { return; }
97 
98  [[nodiscard]] constexpr bool CanBeCarried() const noexcept { return data.flags.all(TES_LIGHT_FLAGS::kCanCarry); }
99 
100  // members
101  OBJ_LIGH data; // 0E0 - DATA
102  float fade; // 108 - FNAM
103  std::uint32_t pad10C; // 10C
106  std::uint32_t pad124; // 124
108  };
109  static_assert(sizeof(TESObjectLIGH) == 0x130);
110 }
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSEquipSlot.h:10
Definition: BGSEquipType.h:9
Definition: BGSLensFlare.h:12
Definition: BGSMessageIcon.h:9
Definition: BGSSoundDescriptorForm.h:14
Definition: NiAVObject.h:45
Definition: NiColor.h:9
Definition: TESBoundAnimObject.h:8
Definition: TESBoundObject.h:24
Definition: TESFile.h:14
Definition: TESFullName.h:9
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESObjectLIGH.h:64
float fade
Definition: TESObjectLIGH.h:102
OBJ_LIGH data
Definition: TESObjectLIGH.h:101
NiAVObject * LoadGraphics(TESObjectREFR *a_ref) override
BGSSoundDescriptorForm * sound
Definition: TESObjectLIGH.h:104
void SetEquipSlot(BGSEquipSlot *a_slot) override
bool Activate(TESObjectREFR *a_targetRef, TESObjectREFR *a_activatorRef, std::uint8_t a_arg3, TESBoundObject *a_object, std::int32_t a_targetCount) override
void LoadGame(BGSLoadFormBuffer *a_buf) override
void InitializeData() override
static constexpr auto FORMTYPE
Definition: TESObjectLIGH.h:67
void UnClone3D(TESObjectREFR *a_ref) override
BGSEquipSlot * GetEquipSlot() const override
std::uint32_t pad10C
Definition: TESObjectLIGH.h:103
std::uint32_t pad124
Definition: TESObjectLIGH.h:106
void SaveGame(BGSSaveFormBuffer *a_buf) override
bool Load(TESFile *a_mod) override
static constexpr auto RTTI
Definition: TESObjectLIGH.h:66
BGSLensFlare * lensFlare
Definition: TESObjectLIGH.h:107
constexpr bool CanBeCarried() const noexcept
Definition: TESObjectLIGH.h:98
~TESObjectLIGH() override
void InitItemImpl() override
NiAVObject * Clone3D(TESObjectREFR *a_ref) override
NiColor emittanceColor
Definition: TESObjectLIGH.h:105
Definition: TESObjectREFR.h:105
Definition: TESValueForm.h:10
Definition: TESWeightForm.h:8
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: PCH.h:329
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESObjectLIGH
Definition: Offsets_RTTI.h:6037
TES_LIGHT_FLAGS
Definition: TESObjectLIGH.h:19
Definition: Color.h:6
Definition: TESObjectLIGH.h:38
float fov
Definition: TESObjectLIGH.h:46
std::int32_t time
Definition: TESObjectLIGH.h:41
float flickerMovementAmplitude
Definition: TESObjectLIGH.h:50
Color color
Definition: TESObjectLIGH.h:43
stl::enumeration< TES_LIGHT_FLAGS, std::uint32_t > flags
Definition: TESObjectLIGH.h:44
float flickerIntensityAmplitude
Definition: TESObjectLIGH.h:49
float flickerPeriodRecip
Definition: TESObjectLIGH.h:48
float fallofExponent
Definition: TESObjectLIGH.h:45
std::uint32_t radius
Definition: TESObjectLIGH.h:42
float nearDistance
Definition: TESObjectLIGH.h:47
Definition: TESObjectLIGH.h:70
RecordFlag
Definition: TESObjectLIGH.h:72
@ kObstacle
Definition: TESObjectLIGH.h:77
@ kRandomAnimStart
Definition: TESObjectLIGH.h:75
@ kPortalStrict
Definition: TESObjectLIGH.h:76
@ kDeleted
Definition: TESObjectLIGH.h:73
@ kIgnored
Definition: TESObjectLIGH.h:74