CommonLibSSE (powerof3)
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  class NiLight;
19 
20  enum class TES_LIGHT_FLAGS
21  {
22  kNone = 0,
23  kDynamic = 1 << 0,
24  kCanCarry = 1 << 1,
25  kNegative = 1 << 2,
26  kFlicker = 1 << 3,
27  kDeepCopy = 1 << 4,
28  kOffByDefault = 1 << 5,
29  kFlickerSlow = 1 << 6,
30  kPulse = 1 << 7,
31  kPulseSlow = 1 << 8,
32  kSpotlight = 1 << 9,
33  kSpotShadow = 1 << 10,
34  kHemiShadow = 1 << 11,
35  kOmniShadow = 1 << 12,
36  kPortalStrict = 1 << 13,
37 
39  };
40 
41  struct OBJ_LIGH // DATA
42  {
43  public:
44  // members
45  std::int32_t time; // 00
46  std::uint32_t radius; // 04
47  Color color; // 08
49  float fallofExponent; // 10
50  float fov; // 14
51  float nearDistance; // 18
52  float flickerPeriodRecip; // 1C - CK value * 100
55  };
56  static_assert(sizeof(OBJ_LIGH) == 0x28);
57 
58  class TESObjectLIGH :
59  public TESBoundAnimObject, // 000
60  public TESFullName, // 030
61  public TESModelTextureSwap, // 040
62  public TESIcon, // 078
63  public BGSMessageIcon, // 088
64  public TESWeightForm, // 0A0
65  public TESValueForm, // 0B0
66  public BGSDestructibleObjectForm, // 0C0
67  public BGSEquipType // 0D0
68  {
69  public:
70  inline static constexpr auto RTTI = RTTI_TESObjectLIGH;
71  inline static constexpr auto VTABLE = VTABLE_TESObjectLIGH;
72  inline static constexpr auto FORMTYPE = FormType::Light;
73 
74  struct RecordFlags
75  {
76  enum RecordFlag : std::uint32_t
77  {
78  kDeleted = 1 << 5,
79  kIgnored = 1 << 12,
80  kRandomAnimStart = 1 << 16,
81  kPortalStrict = 1 << 17,
82  kObstacle = 1 << 25
83  };
84  };
85 
86  ~TESObjectLIGH() override; // 00
87 
88  // override (TESBoundAnimObject)
89  void InitializeData() override; // 04
90  bool Load(TESFile* a_mod) override; // 06
91  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
92  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
93  void InitItemImpl() override; // 13
94  bool Activate(TESObjectREFR* a_targetRef, TESObjectREFR* a_activatorRef, std::uint8_t a_arg3, TESBoundObject* a_object, std::int32_t a_targetCount) override; // 37
95  void UnClone3D(TESObjectREFR* a_ref) override; // 41
96  NiAVObject* LoadGraphics(TESObjectREFR* a_ref) override; // 47
97  NiAVObject* Clone3D(TESObjectREFR* a_ref) override; // 4A
98 
99  // override (BGSEquipType)
100  BGSEquipSlot* GetEquipSlot() const override; // 04
101  void SetEquipSlot(BGSEquipSlot* a_slot) override; // 05 - { return; }
102 
103  [[nodiscard]] constexpr bool CanBeCarried() const noexcept { return data.flags.all(TES_LIGHT_FLAGS::kCanCarry); }
105 
106  NiLight* GenDynamic(RE::TESObjectREFR* a_ref, RE::NiNode* a_node, char a_forceDynamic, char a_useLightRadius, char a_affectRefOnly)
107  {
108  using func_t = decltype(&TESObjectLIGH::GenDynamic);
109  static REL::Relocation<func_t> func{ RELOCATION_ID(17208, 17610) };
110  return func(this, a_ref, a_node, a_forceDynamic, a_useLightRadius, a_affectRefOnly);
111  }
112 
113  // members
114  OBJ_LIGH data; // 0E0 - DATA
115  float fade; // 108 - FNAM
116  std::uint32_t pad10C; // 10C
119  std::uint32_t pad124; // 124
121  };
122  static_assert(sizeof(TESObjectLIGH) == 0x130);
123 }
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:505
Definition: Relocation.h:210
constexpr bool none(Args... a_args) const noexcept requires(std
Definition: EnumSet.h:106
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: EnumSet.h:99
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSEquipSlot.h:10
Definition: BGSEquipType.h:9
Definition: BGSLensFlare.h:12
Definition: BGSLoadFormBuffer.h:11
Definition: BGSMessageIcon.h:9
Definition: BGSSaveFormBuffer.h:8
Definition: BGSSoundDescriptorForm.h:14
Definition: NiAVObject.h:51
Definition: NiColor.h:11
Definition: NiLight.h:10
Definition: NiNode.h:12
Definition: TESBoundAnimObject.h:8
Definition: TESBoundObject.h:24
Definition: TESFile.h:17
Definition: TESFullName.h:9
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESObjectLIGH.h:68
float fade
Definition: TESObjectLIGH.h:115
OBJ_LIGH data
Definition: TESObjectLIGH.h:114
NiAVObject * LoadGraphics(TESObjectREFR *a_ref) override
BGSSoundDescriptorForm * sound
Definition: TESObjectLIGH.h:117
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
static constexpr auto VTABLE
Definition: TESObjectLIGH.h:71
constexpr bool GetNoFlicker() const noexcept
Definition: TESObjectLIGH.h:104
void LoadGame(BGSLoadFormBuffer *a_buf) override
void InitializeData() override
static constexpr auto FORMTYPE
Definition: TESObjectLIGH.h:72
void UnClone3D(TESObjectREFR *a_ref) override
BGSEquipSlot * GetEquipSlot() const override
std::uint32_t pad10C
Definition: TESObjectLIGH.h:116
std::uint32_t pad124
Definition: TESObjectLIGH.h:119
void SaveGame(BGSSaveFormBuffer *a_buf) override
bool Load(TESFile *a_mod) override
static constexpr auto RTTI
Definition: TESObjectLIGH.h:70
NiLight * GenDynamic(RE::TESObjectREFR *a_ref, RE::NiNode *a_node, char a_forceDynamic, char a_useLightRadius, char a_affectRefOnly)
Definition: TESObjectLIGH.h:106
BGSLensFlare * lensFlare
Definition: TESObjectLIGH.h:120
constexpr bool CanBeCarried() const noexcept
Definition: TESObjectLIGH.h:103
~TESObjectLIGH() override
void InitItemImpl() override
NiAVObject * Clone3D(TESObjectREFR *a_ref) override
NiColor emittanceColor
Definition: TESObjectLIGH.h:118
Definition: TESObjectREFR.h:114
Definition: TESValueForm.h:8
Definition: TESWeightForm.h:8
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 9 > VTABLE_TESObjectLIGH
Definition: Offsets_VTABLE.h:12866
constexpr REL::ID RTTI_TESObjectLIGH(static_cast< std::uint64_t >(513874))
TES_LIGHT_FLAGS
Definition: TESObjectLIGH.h:21
Definition: Color.h:8
Definition: TESObjectLIGH.h:42
float fov
Definition: TESObjectLIGH.h:50
std::int32_t time
Definition: TESObjectLIGH.h:45
float flickerMovementAmplitude
Definition: TESObjectLIGH.h:54
Color color
Definition: TESObjectLIGH.h:47
float flickerIntensityAmplitude
Definition: TESObjectLIGH.h:53
float flickerPeriodRecip
Definition: TESObjectLIGH.h:52
float fallofExponent
Definition: TESObjectLIGH.h:49
REX::EnumSet< TES_LIGHT_FLAGS, std::uint32_t > flags
Definition: TESObjectLIGH.h:48
std::uint32_t radius
Definition: TESObjectLIGH.h:46
float nearDistance
Definition: TESObjectLIGH.h:51
Definition: TESObjectLIGH.h:75
RecordFlag
Definition: TESObjectLIGH.h:77
@ kObstacle
Definition: TESObjectLIGH.h:82
@ kRandomAnimStart
Definition: TESObjectLIGH.h:80
@ kPortalStrict
Definition: TESObjectLIGH.h:81
@ kDeleted
Definition: TESObjectLIGH.h:78
@ kIgnored
Definition: TESObjectLIGH.h:79