From 078848f2013b9bb472f839ef46d95e799f0a81bb Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 31 Dec 2024 19:16:08 -0500 Subject: [PATCH] fix(unrealengine): add back Psychonauts 2 patches --- src/games/unrealengine/addon.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/games/unrealengine/addon.cpp b/src/games/unrealengine/addon.cpp index c685993b..a287e886 100644 --- a/src/games/unrealengine/addon.cpp +++ b/src/games/unrealengine/addon.cpp @@ -485,18 +485,8 @@ void AddUpgrade(reshade::api::format old_format, bool ignore_size = true) { void AddPsychonauts2Patches() { renodx::mods::swapchain::force_borderless = false; - renodx::mods::swapchain::swap_chain_upgrade_targets.push_back({ - .old_format = reshade::api::format::r10g10b10a2_unorm, - .new_format = reshade::api::format::r16g16b16a16_float, - .ignore_size = true, - .usage_include = reshade::api::resource_usage::render_target, - }); - renodx::mods::swapchain::swap_chain_upgrade_targets.push_back({ - .old_format = reshade::api::format::r11g11b10_float, - .new_format = reshade::api::format::r16g16b16a16_float, - .ignore_size = true, - .usage_include = reshade::api::resource_usage::render_target, - }); + reshade::set_config_value(nullptr, renodx::utils::settings::global_name.c_str(), "Upgrade_UseSCRGB", 1); + reshade::set_config_value(nullptr, renodx::utils::settings::global_name.c_str(), "Upgrade_R10G10B10A2_UNORM", 3); } void AddGamePatches() { @@ -504,6 +494,9 @@ void AddGamePatches() { auto process_path = renodx::utils::platform::GetCurrentProcessPath(); auto filename = process_path.filename().string(); + if (filename == "Psychonauts2-WinGDK-Shipping.exe") { + AddPsychonauts2Patches(); + } for (const auto& [key, format] : UPGRADE_TARGETS) { uint32_t value; @@ -734,7 +727,6 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) { if (!initialized) { AddGamePatches(); - AddAdvancedSettings(); for (auto* new_setting : info_settings) { @@ -769,6 +761,7 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) { renodx::utils::resource::Use(fdw_reason); reshade::unregister_event(OnInitDevice); reshade::unregister_event(OnInitSwapchain); + reshade::unregister_event(OnDrawForLUTDump); reshade::unregister_addon(h_module); break; }