Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update clib with portal RE and perf relocation fixes (#700) #701

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -687,6 +687,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 @@ -712,9 +718,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 @@ -739,17 +744,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 @@ -61,8 +61,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
Loading