From 0c5a25ed1a1e17834111d8ff8bf77b8fd5fc4429 Mon Sep 17 00:00:00 2001 From: powerof3 Date: Fri, 22 Nov 2024 12:48:58 +0530 Subject: [PATCH] Add `ShadowSceneNode::Add/RemoveLight` --- include/RE/S/ShadowSceneNode.h | 2 ++ src/RE/S/ShadowSceneNode.cpp | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/RE/S/ShadowSceneNode.h b/include/RE/S/ShadowSceneNode.h index d78be60bb..d325ad1e5 100644 --- a/include/RE/S/ShadowSceneNode.h +++ b/include/RE/S/ShadowSceneNode.h @@ -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& a_light); // members std::uint64_t unk128; // 128 diff --git a/src/RE/S/ShadowSceneNode.cpp b/src/RE/S/ShadowSceneNode.cpp index f73a2a0ad..8afffc3ba 100644 --- a/src/RE/S/ShadowSceneNode.cpp +++ b/src/RE/S/ShadowSceneNode.cpp @@ -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{ 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{ RELOCATION_ID(99693, 106327) }; + return func(this, a_light); + } + BSLight* ShadowSceneNode::GetLight(NiLight* a_light) { auto light = GetPointLight(a_light); @@ -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{ RELOCATION_ID(99697, 106331) }; return func(this, a_light); } + + void ShadowSceneNode::RemoveLight(const NiPointer& a_light) + { + using func_t = void (*)(ShadowSceneNode*, const NiPointer&); + static REL::Relocation func{ RELOCATION_ID(99698, 106332) }; + return func(this, a_light); + } }