Skip to content
Closed
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
Empty file added cmake/ports/.gitkeep
Empty file.
41 changes: 28 additions & 13 deletions src/XSEPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "ShaderCache.h"
#include "State.h"
#include "Menu.h"
#include <fmt/xchar.h>

#include "ENB/ENBSeriesAPI.h"

Expand All @@ -28,25 +29,39 @@ void MessageHandler(SKSE::MessagingInterface::Message* message)
switch (message->type) {
case SKSE::MessagingInterface::kPostPostLoad:
{
Hooks::Install();
const std::array dlls = {
L"ShaderTools",
L"ENBHelperSE",
L"ENBHelperVR",
L"ENBHelperPlus"
};
auto incompatible = false;
for (const auto dll : dlls) {
if (GetModuleHandle(dll)) {
logger::info(fmt::runtime("Incompatible DLL {} detected, will disable all hooks and features"), stl::utf16_to_utf8(dll).value_or("<unicode conversion error>"s));
incompatible = true;
}
}
if (!incompatible) {
Hooks::Install();

//auto& shaderCache = SIE::ShaderCache::Instance();
//auto& shaderCache = SIE::ShaderCache::Instance();

//shaderCache.SetEnabled(true);
//shaderCache.SetAsync(true);
//shaderCache.SetDiskCache(true);
//shaderCache.SetEnabled(true);
//shaderCache.SetAsync(true);
//shaderCache.SetDiskCache(true);

//State::GetSingleton()->Load();
//State::GetSingleton()->Load();

//shaderCache.ValidateDiskCache();
//shaderCache.ValidateDiskCache();

if (reshade::register_addon(m_hModule)) {
logger::info("ReShade: Registered add-on");
// reshade::register_event<reshade::addon_event::reshade_overlay>(DrawOverlayCallback);
} else {
logger::info("ReShade: Could not register add-on");
if (reshade::register_addon(m_hModule)) {
logger::info("ReShade: Registered add-on");
// reshade::register_event<reshade::addon_event::reshade_overlay>(DrawOverlayCallback);
} else {
logger::info("ReShade: Could not register add-on");
}
}

break;
}
case SKSE::MessagingInterface::kDataLoaded:
Expand Down