diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 55b22fbb69..e2c9017450 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -856,43 +856,6 @@ namespace Hooks stl::write_thunk_call(REL::RelocationID(100852, 107642).address() + REL::Relocate(0x29E, 0x28F)); stl::write_thunk_call(REL::RelocationID(100871, 107667).address() + REL::Relocate(0xEE, 0xED)); - const auto renderPassCacheCtor = REL::VariantID(100720, 107500, 0x1340330); // VR function is identical to SE - const int32_t passCount = 4194240; - const int32_t passCountSE = 4194240 * 16; - - const int32_t passSize = 4194240 * sizeof(RE::BSRenderPass); - const int32_t lightsCount = passCount * 16; - const int32_t lightsSize = lightsCount * sizeof(void*); - const int32_t lastPassIndex = passCount - 1; - const int32_t lastPassOffset = - (passCount - 1) * sizeof(RE::BSRenderPass); - const int32_t lastPassNextOffset = - (passCount - 1) * sizeof(RE::BSRenderPass) + offsetof(RE::BSRenderPass, next); - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0x76).address(), - reinterpret_cast(&lightsSize), 4); - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0xAD).address(), - reinterpret_cast(&passSize), 4); - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0xCB).address(), - reinterpret_cast(&lastPassIndex), 4); - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0xF0).address(), - reinterpret_cast(&lastPassNextOffset), 4); - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0xFD).address(), - reinterpret_cast(&lastPassOffset), 4); - if (REL::Module::IsAE()) { - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0x191).address(), - reinterpret_cast(&passCount), 4); - } else { - PatchMemory( - REL::Relocation(renderPassCacheCtor, 0x191 - 2).address(), - reinterpret_cast(&passCountSE), 4); - } - // Patch render space in BSLightingShader::SetupGeometry to always use world space // The variable updateEyePosition is set to 1 when not skinned. By patching to be 0 it will always use world space // We offset from the base address of the containing function to the start of the patch diff --git a/src/XSEPlugin.cpp b/src/XSEPlugin.cpp index 7485f0ef52..f1d1c9e13b 100644 --- a/src/XSEPlugin.cpp +++ b/src/XSEPlugin.cpp @@ -169,13 +169,13 @@ bool Load() auto log = spdlog::default_logger(); log->set_level(state->GetLogLevel()); - const std::array dlls = { + const std::array incompatibleDLLs = { L"Data/SKSE/Plugins/ShaderTools.dll", L"Data/SKSE/Plugins/SSEShaderTools.dll", L"Data/SKSE/Plugins/SkyrimUpscaler.dll" }; - for (const auto dll : dlls) { + for (const auto dll : incompatibleDLLs) { if (LoadLibrary(dll)) { auto errorMessage = std::format("Incompatible DLL {} detected", stl::utf16_to_utf8(dll).value_or(""s)); logger::error("{}", errorMessage); @@ -183,6 +183,18 @@ bool Load() } } + const std::array requiredDLLs = { + L"Data/SKSE/Plugins/EngineFixes.dll" + }; + + for (const auto dll : requiredDLLs) { + if (LoadLibrary(dll)) { + auto errorMessage = std::format("Required DLL {} was missing", stl::utf16_to_utf8(dll).value_or(""s)); + logger::error("{}", errorMessage); + errors.push_back(errorMessage); + } + } + if (errors.empty()) { logger::info("Calling feature Load methods"); for (auto* feature : Feature::GetFeatureList()) {