From ec55340e6e8ef2d6006c8023f1aad3bcf5a2d6e1 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Tue, 7 Oct 2025 18:00:27 +0200 Subject: [PATCH] Add cutscenes ultrawide and framerate fixes --- SilentHillf/dllmain.cpp | 42 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/SilentHillf/dllmain.cpp b/SilentHillf/dllmain.cpp index 4cd0aa2..cff99ba 100644 --- a/SilentHillf/dllmain.cpp +++ b/SilentHillf/dllmain.cpp @@ -28,6 +28,8 @@ static SetBoolFn SetDOFFixEnabled = nullptr; static SetBoolFn SetCAFixEnabled = nullptr; static SetBoolFn SetVignettingFixEnabled = nullptr; static SetBoolFn SetCameraFixEnabled = nullptr; +static SetBoolFn SetCutscenesFixEnabled = nullptr; +static SetBoolFn SetCutscenesFPSFixEnabled = nullptr; static SetBoolFn SetVolumetricFogFixEnabled = nullptr; static SetBoolFn SetFogDensityFixEnabled = nullptr; static SetBoolFn SetFogMaxOpacityFixEnabled = nullptr; @@ -43,6 +45,8 @@ static bool DOF_fix_enabled = false; static bool CA_fix_enabled = false; static bool Vignetting_fix_enabled = false; static bool camera_fix_enabled = false; +static bool cutscenes_fix_enabled = false; +static bool cutscenes_FPS_fix_enabled = false; static bool volumetric_fog_fix_enabled = false; static bool Fog_density_fix_enabled = false; static bool Fog_max_opacity_fix_enabled = false; @@ -56,8 +60,8 @@ static bool popup_Informations = false; // Plugin settings const std::string SETTINGS_FILE = "./pluginsettings.ini"; -const char* FIX_VERSION = "1.0.3.1"; -const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Control camera distance.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Control fog.\n - Re enable console.\n\nDisabling Fog will not entirely remove it."; +const char* FIX_VERSION = "1.0.4"; +const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Control camera distance.\n - Unlock cutscenes FPS and enable ultrawide.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Control fog.\n - Re enable console.\n\nDisabling Fog will not entirely remove it."; const char* DONATION_URL = "https://buymeacoffee.com/k4sh44"; // Scaling factor based on screen resolution @@ -92,6 +96,8 @@ static void LoadFixDLL() SetFogDensityFixEnabled = (SetBoolFn)GetProcAddress(fixLib,"SetFogDensityFixEnabled"); SetFogMaxOpacityFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFogMaxOpacityFixEnabled"); SetCameraFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCameraFixEnabled"); + SetCutscenesFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCutscenesFixEnabled"); + SetCutscenesFPSFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCutscenesFPSFixEnabled"); SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV"); SetCameraDistance = (SetFloatFn)GetProcAddress(fixLib, "SetCameraDistance"); SetFogDensity = (SetFloatFn)GetProcAddress(fixLib,"SetFogDensity"); @@ -105,6 +111,8 @@ static void LoadFixDLL() if (SetFogMaxOpacity) SetFogMaxOpacity(fogMaxOpacityValue); if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true); if (SetCameraFixEnabled) SetCameraFixEnabled(camera_fix_enabled, true); + if (SetCutscenesFixEnabled) SetCutscenesFixEnabled(cutscenes_fix_enabled, true); + if (SetCutscenesFPSFixEnabled) SetCutscenesFPSFixEnabled(cutscenes_FPS_fix_enabled, true); if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true); if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, true); if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true); @@ -127,6 +135,8 @@ static void SaveSettings() pluginIniFile["2#Individual fix"].setComment("Controls each fix individually"); pluginIniFile["2#Individual fix"]["FOV"] = fov_fix_enabled; pluginIniFile["2#Individual fix"]["Camera"] = camera_fix_enabled; + pluginIniFile["2#Individual fix"]["Cutscenes"] = cutscenes_fix_enabled; + pluginIniFile["2#Individual fix"]["CutscenesFPS"] = cutscenes_FPS_fix_enabled; pluginIniFile["2#Individual fix"]["DOF"] = DOF_fix_enabled; pluginIniFile["2#Individual fix"]["Chromatic aberrations"] = CA_fix_enabled; pluginIniFile["2#Individual fix"]["Vignetting"] = Vignetting_fix_enabled; @@ -150,6 +160,8 @@ static void LoadSettings() fix_enabled = pluginIniFile["1#General fix"]["Enabled"].as(); fov_fix_enabled = pluginIniFile["2#Individual fix"]["FOV"].as(); camera_fix_enabled = pluginIniFile["2#Individual fix"]["Camera"].as(); + cutscenes_fix_enabled = pluginIniFile["2#Individual fix"]["Cutscenes"].as(); + cutscenes_FPS_fix_enabled = pluginIniFile["2#Individual fix"]["CutscenesFPS"].as(); DOF_fix_enabled = pluginIniFile["2#Individual fix"]["DOF"].as(); CA_fix_enabled = pluginIniFile["2#Individual fix"]["Chromatic aberrations"].as(); Vignetting_fix_enabled = pluginIniFile["2#Individual fix"]["Vignetting"].as(); @@ -175,7 +187,13 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) ImGui::SetNextWindowSize(ImVec2(350 * scale, 150 * scale), ImGuiCond_Once); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.84f, 0.12f, 0.51f, 1.0f)); // red + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.84f, 0.12f, 0.51f, 1.0f)); // red + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.84f, 0.2f, 0.51f, 1.0f)); // red + ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8f, 1.f, 1.f, 1.f)); // white if (ImGui::Button("Like my work ? Consider donation")) ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); // Donation + ImGui::PopStyleColor(4); // Restore color + ImGui::SameLine(); if (ImGui::Button("Fix informations")) popup_Informations = true; // Fix information @@ -214,6 +232,16 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) SaveSettings(); } + if (ImGui::Checkbox("Cutscenes", &cutscenes_fix_enabled)) { + if (SetCutscenesFixEnabled) SetCutscenesFixEnabled(cutscenes_fix_enabled, false); + SaveSettings(); + } + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("Must be enabled before playing cutscenes."); + ImGui::EndTooltip(); + } + if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) { if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false); SaveSettings(); @@ -235,6 +263,16 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime) SaveSettings(); } + if (ImGui::Checkbox("Cutscenes FPS", &cutscenes_FPS_fix_enabled)) { + if (SetCutscenesFPSFixEnabled) SetCutscenesFPSFixEnabled(cutscenes_FPS_fix_enabled, false); + SaveSettings(); + } + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("Must be enabled before playing cutscenes."); + ImGui::EndTooltip(); + } + if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) { if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false); SaveSettings();