Skip to content

Commit

Permalink
Add ShadowSceneNode::Add/RemoveLight
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Nov 22, 2024
1 parent cf619e5 commit 0c5a25e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/RE/S/ShadowSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ namespace RE
void OnVisible(NiCullingProcess& a_process) override; // 34

BSLight* AddLight(NiLight* a_light, const LIGHT_CREATE_PARAMS& a_params);
void AddLight(BSLight* a_light);
BSLight* GetLight(NiLight* a_light);
BSLight* GetPointLight(NiLight* a_light);
BSLight* GetShadowLight(NiLight* a_light);
void RemoveLight(NiLight* a_light);
void RemoveLight(const NiPointer<BSLight>& a_light);

// members
std::uint64_t unk128; // 128
Expand Down
18 changes: 16 additions & 2 deletions src/RE/S/ShadowSceneNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ namespace RE
{
BSLight* ShadowSceneNode::AddLight(NiLight* a_light, const ShadowSceneNode::LIGHT_CREATE_PARAMS& a_params)
{
using func_t = decltype(&ShadowSceneNode::AddLight);
using func_t = BSLight* (*)(ShadowSceneNode*, NiLight*, const ShadowSceneNode::LIGHT_CREATE_PARAMS&);
static REL::Relocation<func_t> func{ RELOCATION_ID(99692, 106326) };
return func(this, a_light, a_params);
}

void ShadowSceneNode::AddLight(BSLight* a_light)
{
using func_t = void (*)(ShadowSceneNode*, BSLight*);
static REL::Relocation<func_t> func{ RELOCATION_ID(99693, 106327) };
return func(this, a_light);
}

BSLight* ShadowSceneNode::GetLight(NiLight* a_light)
{
auto light = GetPointLight(a_light);
Expand Down Expand Up @@ -41,8 +48,15 @@ namespace RE

void ShadowSceneNode::RemoveLight(NiLight* a_light)
{
using func_t = decltype(&ShadowSceneNode::RemoveLight);
using func_t = void (*)(ShadowSceneNode*, NiLight*);
static REL::Relocation<func_t> func{ RELOCATION_ID(99697, 106331) };
return func(this, a_light);
}

void ShadowSceneNode::RemoveLight(const NiPointer<BSLight>& a_light)
{
using func_t = void (*)(ShadowSceneNode*, const NiPointer<BSLight>&);
static REL::Relocation<func_t> func{ RELOCATION_ID(99698, 106332) };
return func(this, a_light);
}
}

0 comments on commit 0c5a25e

Please sign in to comment.