forked from Ryan-rsm-McKenzie/CommonLibSSE
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
115 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "RE/S/ShadowSceneNode.h" | ||
#include "RE/B/BSLight.h" | ||
|
||
namespace RE | ||
{ | ||
BSLight* ShadowSceneNode::AddLight(NiLight* a_light, const ShadowSceneNode::LIGHT_CREATE_PARAMS& a_params) | ||
{ | ||
using func_t = decltype(&ShadowSceneNode::AddLight); | ||
static REL::Relocation<func_t> func{ RELOCATION_ID(99692, 106326) }; | ||
return func(this, a_light, a_params); | ||
} | ||
|
||
BSLight* ShadowSceneNode::GetLight(NiLight* a_light) | ||
{ | ||
auto light = GetPointLight(a_light); | ||
if (!light) { | ||
light = GetShadowLight(a_light); | ||
} | ||
return light; | ||
} | ||
|
||
BSLight* ShadowSceneNode::GetPointLight(NiLight* a_light) | ||
{ | ||
for (auto& light : activeLights) { | ||
if (light && light->light.get() == a_light) { | ||
return light.get(); | ||
} | ||
} | ||
return nullptr; | ||
} | ||
|
||
BSLight* ShadowSceneNode::GetShadowLight(NiLight* a_light) | ||
{ | ||
for (auto& light : activeShadowLights) { | ||
if (light && light->light.get() == a_light) { | ||
return light.get(); | ||
} | ||
} | ||
return nullptr; | ||
} | ||
|
||
void ShadowSceneNode::RemoveLight(NiLight* a_light) | ||
{ | ||
using func_t = decltype(&ShadowSceneNode::RemoveLight); | ||
static REL::Relocation<func_t> func{ RELOCATION_ID(99697, 106331) }; | ||
return func(this, a_light); | ||
} | ||
} |