Skip to content

Commit

Permalink
Merge pull request #701 from doodlum/dev
Browse files Browse the repository at this point in the history
build: update clib with portal RE and perf relocation fixes (#700)
  • Loading branch information
doodlum authored Oct 27, 2024
2 parents f802cd2 + ab26c3d commit f106076
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG updated 148 files
20 changes: 10 additions & 10 deletions src/Features/LightLimitFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,12 @@ float3 LightLimitFix::Saturation(float3 color, float saturation)
return color;
}

namespace RE
{
class BSMultiBoundRoom : public NiNode
{};
}

void LightLimitFix::UpdateLights()
{
static float& cameraNear = (*(float*)(REL::RelocationID(517032, 403540).address() + 0x40));
Expand All @@ -758,9 +764,8 @@ void LightLimitFix::UpdateLights()

roomNodes.empty();

auto addRoom = [&](void* nodePtr, LightData& light) {
auto addRoom = [&](RE::NiNode* node, LightData& light) {
uint8_t roomIndex = 0;
auto* node = static_cast<RE::NiNode*>(nodePtr);
if (auto it = roomNodes.find(node); it == roomNodes.cend()) {
roomIndex = static_cast<uint8_t>(roomNodes.size());
roomNodes.insert_or_assign(node, roomIndex);
Expand All @@ -785,17 +790,12 @@ void LightLimitFix::UpdateLights()

if (!IsGlobalLight(bsLight)) {
// List of BSMultiBoundRooms affected by a light
for (const auto& roomPtr : bsLight->unk0D8) {
for (const auto& roomPtr : bsLight->rooms) {
addRoom(roomPtr, light);
}
// List of BSPortals affected by a light
for (const auto& portalPtr : bsLight->unk0F0) {
struct BSPortal
{
uint8_t data[0x128];
void* portalSharedNode;
};
addRoom(static_cast<BSPortal*>(portalPtr)->portalSharedNode, light);
for (const auto& portalPtr : bsLight->portals) {
addRoom(portalPtr->portalSharedNode.get(), light);
}
light.lightFlags.set(LightFlags::PortalStrict);
}
Expand Down
4 changes: 2 additions & 2 deletions src/XSEPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ extern "C" DLLEXPORT constinit auto SKSEPlugin_Version = []() noexcept {
SKSE::PluginVersionData v;
v.PluginName(Plugin::NAME.data());
v.PluginVersion(Plugin::VERSION);
v.UsesAddressLibrary(true);
v.HasNoStructUse();
v.UsesAddressLibrary();
v.UsesNoStructs();
return v;
}();

Expand Down

0 comments on commit f106076

Please sign in to comment.