Compare commits

..

21 Commits

Author SHA1 Message Date
ebb08a6b37 Fixed camera distance fix not initialising 2025-09-15 15:11:43 +02:00
7f6065d87f Builkd optimisations 2025-09-15 14:10:24 +02:00
b77c5fcd70 Add camera distance 2025-09-15 11:46:17 +02:00
af413f1d10 Improved UI scaling 2025-09-14 22:41:16 +02:00
5558483c96 Add dev console and improved UI scaling 2025-09-14 22:40:25 +02:00
5509e115f5 Hell Is Us project build settings change to avoid to trigger AV 2025-09-14 22:38:58 +02:00
8ac0373374 UI scaling improvement 2025-09-13 11:40:28 +02:00
986646e8b1 Update fix version 2025-09-10 21:55:02 +02:00
9cfcda2756 Change build options to not trigger AV 2025-09-09 08:18:36 +02:00
81912e9b74 Fix a bug where camera distance would be set to int instead of float 2025-09-09 07:27:58 +02:00
5b5d72585d Add camera distance 2025-09-09 06:18:20 +02:00
3b0b0ea00d Remove unnecessary include 2025-09-07 22:42:09 +02:00
88fcf9b761 English syntax correction 2025-09-07 19:17:10 +02:00
78fb746242 Remove commented code 2025-09-07 18:52:00 +02:00
07dfc091aa Add Unreal Engine re-enabling. Add fix informations 2025-09-07 18:50:12 +02:00
88950de211 Change addon version 2025-09-05 11:34:11 +02:00
0ed32df0bb Add 20 extra more degrees to FOV 2025-09-04 11:34:36 +02:00
7625accaf7 Add Chronos : The New Dawn 2025-09-04 10:40:56 +02:00
fad7c70afd Test getters functions before calling them 2025-09-03 14:36:30 +02:00
ee49ed1f54 Test getters functions before calling them 2025-09-03 12:28:34 +02:00
4129677b7e Add chromatic aberrations. 2025-09-02 14:47:15 +02:00
7 changed files with 691 additions and 494 deletions

View File

@@ -21,10 +21,10 @@
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}</ProjectGuid>
<RootNamespace>Gears Of War Reloaded</RootNamespace>
<ProjectGuid>{CFE5F26D-A180-4ED1-B696-7985053B14BA}</ProjectGuid>
<RootNamespace>Cronos The New Dawn</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>Gears Of War Reloaded</ProjectName>
<ProjectName>Cronos The New Dawn</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -50,7 +50,7 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -140,6 +140,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WholeProgramOptimization>false</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@@ -0,0 +1,354 @@
#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H
#define IMGUI_HAS_DOCK 1
#include <imgui.h>
#include <reshade.hpp>
#include <fstream>
#include <string>
#include <Windows.h>
// Screen informations
static int screenWidth = GetSystemMetrics(SM_CXSCREEN);
static int screenHeight = GetSystemMetrics(SM_CYSCREEN);
static float aspectRatio = (float)screenWidth / screenHeight;
// Core game dll functions declarations
typedef void (*SetBoolFn)(bool, bool);
typedef void (*SetIntFn)(int);
typedef void (*SetFloatFn)(float);
typedef float (*GetFloatFn)();
typedef bool (*GetBoolFn)();
typedef void (*SetUEConsole)();
static HMODULE fixLib = nullptr;
static SetBoolFn SetFixEnabled = nullptr;
static SetBoolFn SetFOVFixEnabled = nullptr;
static SetBoolFn SetFPSFixEnabled = nullptr;
static SetBoolFn SetResolutionFixEnabled = nullptr;
static SetBoolFn SetAspectRatioFixEnabled = nullptr;
static SetBoolFn SetDOFFixEnabled = nullptr;
static SetBoolFn SetVignettingFixEnabled = nullptr;
static SetBoolFn SetFogFixEnabled = nullptr;
static SetBoolFn SetCameraDistanceFixEnabled = nullptr;
static SetIntFn SetFOV = nullptr;
static SetFloatFn SetCameraDistance = nullptr;
static GetFloatFn GetFOVIn = nullptr;
static GetFloatFn GetCompensadedFOV = nullptr;
static GetFloatFn GetFOVOut = nullptr;
static GetBoolFn GetConsoleEnabled = nullptr;
static SetUEConsole SetConsole = nullptr;
// Plugin variables for checkboxes and sliders
static bool fov_fix_enabled = false;
static bool FPS_fix_enabled = false;
static bool Resolution_fix_enabled = false;
static bool Aspect_fix_enabled = false;
static bool DOF_fix_enabled = false;
static bool Vignetting_fix_enabled = false;
static bool Fog_fix_enabled = false;
static bool camera_Distance_fix_enabled = false;
static bool fix_enabled = false;
static int worldFOVvalue = 0;
static float cameraDistancevalue = 0.f;
static bool popup_Informations = false;
// Plugin settings
const char* SETTINGS_FILE = "PluginSettings.ini";
const char* GENERAL_FIX_SETTING = "GeneralFIX=";
const char* WORLD_FOV_FIX_SETTING = "WorldFOVFIX=";
const char* ASPECT_FIX_SETTING = "AspectFIX=";
const char* DOF_FIX_SETTING = "DOFFIX=";
const char* VIGNETTING_FIX_SETTING = "VignettingFIX=";
const char* FOG_FIX_SETTING = "FogFIX=";
const char* CAMERA_DISTANCE_FIX_SETTING = "CameraDistanceFIX=";
const char* WORLD_FOV_SETTING = "WorldFOV=";
const char* CAMERA_DISTANCE_SETTING = "CameraDistance=";
const char* FIX_VERSION = "1.0.6";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Control camera distance.\n - Unlock ultrawide resolutions.\n - Remove depth of field.\n - Remove vignetting.\n - Remove fog.\n - Re enable console.";
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
// Facteur de scaling basé sur la résolution verticale
float scale = 1.f;
bool IsAlreadyInitialized()
{
// Declare a lock
HANDLE hMap = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, "Local\\CronosFixSharedSection");
// If lock is not yet initialized
if (hMap == nullptr)
{
// We create the lock only once
hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, 1, "Local\\CronosFixSharedSection");
if (hMap == nullptr) // We ensure the lock is valid
return true;
return false; // First time created we return false
}
// Otherwise we return true
CloseHandle(hMap);
return true;
}
// Load and unload game core dll functions /!\ necessary
static void LoadFixDLL()
{
if (IsAlreadyInitialized())
return; // déjà lancé dans un autre chargement
if (GetModuleHandleA("CronosTNDCore.dll") == nullptr) {
fixLib = LoadLibraryA("CronosTNDCore.dll");
if (!fixLib) {
MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK);
return;
}
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled");
SetAspectRatioFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetAspectRatioFixEnabled");
SetDOFFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDOFFixEnabled");
SetVignettingFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetVignettingFixEnabled");
SetFogFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFogFixEnabled");
SetCameraDistanceFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCameraDistanceFixEnabled");
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
SetCameraDistance = (SetFloatFn)GetProcAddress(fixLib, "SetCameraDistance");
GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn");
GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV");
GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");
SetConsole = (SetUEConsole)GetProcAddress(fixLib, "SetConsole");
GetConsoleEnabled = (GetBoolFn)GetProcAddress(fixLib, "GetConsoleEnabled");
// Apply initial values loaded from settings
if (SetFOV) SetFOV(worldFOVvalue);
if (SetCameraDistance) SetCameraDistance(cameraDistancevalue);
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true);
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, true);
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true);
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true);
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true);
if (SetCameraDistanceFixEnabled) SetCameraDistanceFixEnabled(camera_Distance_fix_enabled, true);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
if (SetConsole) SetConsole();
}
}
// Settings functions
static void SaveSettings()
{
std::ofstream file(SETTINGS_FILE);
if (file.is_open())
{
file << GENERAL_FIX_SETTING << (fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_FIX_SETTING << (fov_fix_enabled ? "1" : "0") << "\n";
file << ASPECT_FIX_SETTING << (Aspect_fix_enabled ? "1" : "0") << "\n";
file << DOF_FIX_SETTING << (DOF_fix_enabled ? "1" : "0") << "\n";
file << VIGNETTING_FIX_SETTING << (Vignetting_fix_enabled ? "1" : "0") << "\n";
file << FOG_FIX_SETTING << (Fog_fix_enabled ? "1" : "0") << "\n";
file << CAMERA_DISTANCE_FIX_SETTING << (camera_Distance_fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_SETTING << worldFOVvalue << "\n";
file << CAMERA_DISTANCE_SETTING << cameraDistancevalue << "\n";
file.close();
}
}
static void LoadSettings()
{
std::ifstream file(SETTINGS_FILE);
if (file.is_open())
{
std::string line;
while (std::getline(file, line))
{
if (line.find(GENERAL_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(GENERAL_FIX_SETTING));
fix_enabled = (val == "1" || val == "true");
}
else if (line.find(WORLD_FOV_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(WORLD_FOV_FIX_SETTING));
fov_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(ASPECT_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(ASPECT_FIX_SETTING));
Aspect_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(DOF_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(DOF_FIX_SETTING));
DOF_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(VIGNETTING_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(VIGNETTING_FIX_SETTING));
Vignetting_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(FOG_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(FOG_FIX_SETTING));
Fog_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(CAMERA_DISTANCE_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(CAMERA_DISTANCE_FIX_SETTING));
camera_Distance_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(WORLD_FOV_SETTING) == 0)
worldFOVvalue = std::stoi(line.substr(strlen(WORLD_FOV_SETTING)));
else if (line.find(CAMERA_DISTANCE_SETTING) == 0)
cameraDistancevalue = std::stof(line.substr(strlen(CAMERA_DISTANCE_SETTING)));
}
file.close();
}
}
// Fix informations
static void displayFixInformations() {
ImGui::SetNextWindowSize(ImVec2(250 * scale, 200 * scale));
ImGui::Begin("Informations", &popup_Informations); //
ImGui::SetCursorPos(ImVec2(10 * scale, 36 * scale));
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::SetCursorPos(ImVec2(10 * scale, 76 * scale));
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
static void on_overlay_draw(reshade::api::effect_runtime* runtime)
{
ImGuiStyle& style = ImGui::GetStyle();
style.ItemSpacing = ImVec2(8 * scale, 8 * scale); // Spacing between widgets
style.FramePadding = ImVec2(3 * scale, 3 * scale); // Widgets padding
style.WindowPadding = ImVec2(10 * scale, 10 * scale); // Overlay padding
scale = (float)screenHeight / 1200.f;
ImGui::SetNextWindowSize(ImVec2(480 * scale, 400 * scale), ImGuiCond_Once);
if (ImGui::Button("Like my work ? Consider donation")) ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); // Donation
ImGui::SameLine();
if (ImGui::Button("Fix informations")) popup_Informations = true; // Fix information
if (popup_Informations)
{
ImGui::Begin("Informations", &popup_Informations);
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
ImGui::Columns(2, NULL, false);
// Drawing a left column with slider and general fix
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen))
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) { if (SetFixEnabled) SetFixEnabled(fix_enabled, false); SaveSettings(); }
// Sliders
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::SetNextItemWidth(150 * scale);
if (ImGui::SliderInt("##FOVValue", &worldFOVvalue, -20, 70)) {
if (SetFOV) SetFOV(worldFOVvalue); SaveSettings();
}
}
if (ImGui::CollapsingHeader("Camera distance (*)", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::SetNextItemWidth(150 * scale);
if (ImGui::SliderFloat("##CameraValue", &cameraDistancevalue, 0, 3)) {
if (SetCameraDistance) SetCameraDistance(cameraDistancevalue); SaveSettings();
}
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Value is a multiplier.");
ImGui::Text("Affects both normal and weapon aiming distance.");
ImGui::EndTooltip();
}
// Individual fixes
ImGui::NextColumn();
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen))
{
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Camera distance", &camera_Distance_fix_enabled)) {
if (SetCameraDistanceFixEnabled) SetCameraDistanceFixEnabled(camera_Distance_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Aspect ratio", &Aspect_fix_enabled)) {
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This is intended for ultrawide only.");
ImGui::Text("Set panini to off in settings to avoid blurry textures and narrow FOV.");
ImGui::EndTooltip();
}
if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) {
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) {
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Fog", &Fog_fix_enabled)) {
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Enabling this fix is a one way.");
ImGui::Text("Reverting it in real time would end in game crash.");
ImGui::Text("So disabling this fix is only possible by doing it here and restart the game.");
ImGui::EndTooltip();
}
}
ImGui::Columns(1);
// Fix status
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::Text("Screen width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
if (GetConsoleEnabled && GetConsoleEnabled())
ImGui::Text("Console enabled and bound to key Tilde");
if (GetFOVIn && GetCompensadedFOV && GetFOVOut)
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Compensated: %.2f, Out: %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
}
}
// Main dll intrance
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
if (!reshade::register_addon(hinstDLL))
return FALSE;
LoadSettings();
reshade::register_overlay("Cronos: The New Dawn", &on_overlay_draw);
reshade::register_event<reshade::addon_event::init_effect_runtime>(
[](reshade::api::effect_runtime* runtime) {
LoadFixDLL();
});
break;
case DLL_PROCESS_DETACH:
reshade::unregister_addon(hinstDLL);
break;
}
return TRUE;
}

View File

@@ -1,231 +0,0 @@
#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H
#define IMGUI_HAS_DOCK 1
#include <imgui.h>
#include <reshade.hpp>
#include <fstream>
#include <string>
#include <Windows.h>
#include <thread>
// Core game dll functions declarations
typedef void (*SetBoolFn)(bool, bool);
typedef void (*SetIntFn)(int);
typedef float (*GetFloatFn)();
// Screen informations
static int screenWidth = GetSystemMetrics(SM_CXSCREEN);
static int screenHeight = GetSystemMetrics(SM_CYSCREEN);
static float aspectRatio = (float)screenWidth / screenHeight;
static HMODULE fixLib = nullptr;
static SetBoolFn SetFixEnabled = nullptr;
static SetBoolFn SetFOVFixEnabled = nullptr;
//static SetBoolFn SetDOFFixEnabled = nullptr;
static SetIntFn SetFOV = nullptr;
static GetFloatFn GetFOVIn = nullptr;
static GetFloatFn GetFOVOut = nullptr;
// Plugin variables for checkboxes and sliders
static bool fov_fix_enabled = false;
static bool DOF_fix_enabled = false;
static bool fix_enabled = false;
static int worldFOVvalue = 0;
static bool popup_Informations = false;
// Plugin settings
const char* SETTINGS_FILE = "PluginSettings.ini";
const char* GENERAL_FIX_SETTING = "GeneralFIX=";
const char* WORLD_FOV_FIX_SETTING = "WorldFOVFIX=";
//const char* DOF_FIX_SETTING = "DOFFIX=";
const char* WORLD_FOV_SETTING = "WorldFOV=";
const char* FIX_VERSION = "1.0.1";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Disable depth of field.";
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
// Load and unload game core dll functions /!\ necessary
static void LoadFixDLL()
{
if (fixLib) return;
//fixLib = LoadLibraryA("GOWRCore.dll");
//if (GetModuleHandleA("GOWRCore.dll") != nullptr) {
// MessageBoxA(nullptr, "core dll loaded", "Erreur", MB_OK);
//}
//if (!fixLib) {
// MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK);
// return;
//}
//SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
//SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled");
////SetDOFFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDOFFixEnabled");
//SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
//GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn");
//GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");;
// Apply initial values loaded from settings
//if (SetFOV) SetFOV(worldFOVvalue);
//if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true);
//if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true);
//if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
}
// Settings functions
static void SaveSettings()
{
std::ofstream file(SETTINGS_FILE);
if (file.is_open())
{
file << GENERAL_FIX_SETTING << (fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_FIX_SETTING << (fov_fix_enabled ? "1" : "0") << "\n";
//file << DOF_FIX_SETTING << (DOF_fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_SETTING << worldFOVvalue << "\n";
file.close();
}
}
static void LoadSettings()
{
std::ifstream file(SETTINGS_FILE);
if (file.is_open())
{
std::string line;
while (std::getline(file, line))
{
if (line.find(GENERAL_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(GENERAL_FIX_SETTING));
fix_enabled = (val == "1" || val == "true");
}
else if (line.find(WORLD_FOV_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(WORLD_FOV_FIX_SETTING));
fov_fix_enabled = (val == "1" || val == "true");
}
//else if (line.find(DOF_FIX_SETTING) == 0)
//{
// std::string val = line.substr(strlen(DOF_FIX_SETTING));
// DOF_fix_enabled = (val == "1" || val == "true");
//}
else if (line.find(WORLD_FOV_SETTING) == 0)
worldFOVvalue = std::stoi(line.substr(strlen(WORLD_FOV_SETTING)));
}
file.close();
}
}
// Fix informations
static void displayFixInformations() {
ImGui::Begin("Informations", &popup_Informations); //
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::SetCursorPos(ImVec2(10, 76));
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
// Initialize ImGui widgets for Reshade
static void on_overlay_draw(reshade::api::effect_runtime* runtime)
{
ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_Once);
ImGui::SetNextWindowSize(ImVec2(350, 150), ImGuiCond_Once);
// Donation ?
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Like my work ?");
ImGui::SetCursorPos(ImVec2(130, 33));
if (ImGui::Button("consider donation"))
{
ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL);
}
// Fix informations
ImGui::SetCursorPos(ImVec2(270, 33));
if (ImGui::Button("Fix informations"))
popup_Informations = true;
if (popup_Informations)
displayFixInformations();
// Generic fix
ImGui::SetCursorPos(ImVec2(10, 60));
ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
SaveSettings();
}
}
ImGui::EndChild();
// FOV adjustment
ImGui::SetCursorPos(ImVec2(10, 120));
ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false);
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::SetNextItemWidth(150.0f);
if (ImGui::SliderInt("", &worldFOVvalue, -20, 50)) {}
if (ImGui::IsItemDeactivatedAfterEdit()) {
if (SetFOV) SetFOV(worldFOVvalue);
SaveSettings();
}
}
ImGui::EndChild();
// Individual fixes
ImGui::SetCursorPos(ImVec2(240, 60));
ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false);
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("FOV fix", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
}
//ImGui::SetCursorPos(ImVec2(5, 55));
//if (ImGui::Checkbox("Depth of field fix", &DOF_fix_enabled)) {
// if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
// SaveSettings();
//}
}
ImGui::EndChild();
// Fix status
ImGui::SetCursorPos(ImVec2(10, 220));
ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true);
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::Text("Screen infos width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
//ImGui::Text("FOV In: %.2f, Out : %.2f", GetFOVIn(), GetFOVOut());
}
ImGui::EndChild();
}
// Main dll intrance
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
if (!reshade::register_addon(hinstDLL))
return FALSE;
LoadSettings();
reshade::register_overlay("Gears Of War Reloaded", &on_overlay_draw);
reshade::register_event<reshade::addon_event::init_effect_runtime>(
[](reshade::api::effect_runtime* runtime) {
LoadFixDLL();
});
break;
case DLL_PROCESS_DETACH:
reshade::unregister_addon(hinstDLL);
break;
}
return TRUE;
}

View File

@@ -50,7 +50,7 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -140,6 +140,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)external\reshade\include;$(SolutionDir)external\reshade\deps\imgui</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@@ -7,10 +7,18 @@
#include <string>
#include <Windows.h>
// Screen informations
static int screenWidth = GetSystemMetrics(SM_CXSCREEN);
static int screenHeight = GetSystemMetrics(SM_CYSCREEN);
static float aspectRatio = (float)screenWidth / screenHeight;
// Core game dll functions declarations
typedef void (*SetBoolFn)(bool, bool);
typedef void (*SetIntFn)(int);
typedef void (*SetFloatFn)(float);
typedef float (*GetFloatFn)();
typedef bool (*GetBoolFn)();
typedef void (*SetUEConsole)();
static HMODULE fixLib = nullptr;
static SetBoolFn SetFixEnabled = nullptr;
@@ -20,10 +28,15 @@ static SetBoolFn SetDOFFixEnabled = nullptr;
static SetBoolFn SetCAFixEnabled = nullptr;
static SetBoolFn SetVignettingFixEnabled = nullptr;
static SetBoolFn SetFogFixEnabled = nullptr;
static SetBoolFn SetCameraDistanceFixEnabled = nullptr;
static SetIntFn SetFOV = nullptr;
static SetFloatFn SetCameraDistance = nullptr;
static GetFloatFn GetFOVIn = nullptr;
static GetFloatFn GetCompensadedFOV = nullptr;
static GetFloatFn GetFOVOut = nullptr;
static GetBoolFn GetConsoleEnabled = nullptr;
static SetUEConsole SetConsole = nullptr;
// Plugin variables for checkboxes and sliders
static bool fov_fix_enabled = false;
@@ -32,8 +45,10 @@ static bool DOF_fix_enabled = false;
static bool CA_fix_enabled = false;
static bool Vignetting_fix_enabled = false;
static bool Fog_fix_enabled = false;
static bool camera_distance_fix_enabled = false;
static bool fix_enabled = false;
static int worldFOVvalue = 0;
static float cameraDistancevalue = 1.f;
static bool popup_Informations = false;
@@ -42,49 +57,85 @@ const char* SETTINGS_FILE = "PluginSettings.ini";
const char* GENERAL_FIX_SETTING = "GeneralFIX=";
const char* WORLD_FOV_FIX_SETTING = "WorldFOVFIX=";
const char* ASPECT_FIX_SETTING = "AspectFIX=";
const char* CAMERA_DISTANCE_FIX_SETTING = "CameraDistanceFIX=";
const char* DOF_FIX_SETTING = "DOFFIX=";
const char* CA_FIX_SETTING = "CAFIX=";
const char* VIGNETTING_FIX_SETTING = "VignettingFIX=";
const char* FOG_FIX_SETTING = "FogFIX=";
const char* WORLD_FOV_SETTING = "WorldFOV=";
const char* FIX_VERSION = "1.0.2";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Disable pillar boxing in cutscences.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable FOG.\n\nDisabling pillar boxing will compensate FOV\nfor main menu and cutscenes.\nDisabling Fog will not entirely remove it.";
const char* CAMERA_DISTANCE_SETTING = "CameraDistance=";
const char* FIX_VERSION = "1.0.4";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Disable pillar boxing in cutscences.\n - Control camera distance.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable FOG.\n - Re enable console.\n\nDisabling pillar boxing will compensate FOV\nfor main menu and cutscenes.\nDisabling Fog will not entirely remove it.";
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
// Scaling factor based on screen resolution
float scale = 1.f;
bool IsAlreadyInitialized()
{
// Declare a lock
HANDLE hMap = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, "Local\\HellisUsFixSharedSection");
// If lock is not yet initialized
if (hMap == nullptr)
{
// We create the lock only once
hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, 1, "Local\\HellisUsFixSharedSection");
if (hMap == nullptr) // We ensure the lock is valid
return true;
return false; // First time created we return false
}
// Otherwise we return true
CloseHandle(hMap);
return true;
}
// Load and unload game core dll functions /!\ necessary
static void LoadFixDLL()
{
if (fixLib) return;
if (IsAlreadyInitialized())
return; // déjà lancé dans un autre chargement
fixLib = LoadLibraryA("HellIsUsCore.dll");
if (GetModuleHandleA("HellIsUsCore.dll") == nullptr) {
fixLib = LoadLibraryA("HellIsUsCore.dll");
if (!fixLib) {
MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK);
return;
if (!fixLib) {
MessageBoxA(nullptr, "Impossible to load game core dll", "Erreur", MB_OK);
return;
}
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled");
SetAspectRatioFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetAspectRatioFixEnabled");
SetDOFFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDOFFixEnabled");
SetCAFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCAFixEnabled");
SetVignettingFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetVignettingFixEnabled");
SetFogFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFogFixEnabled");
SetCameraDistanceFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCameraDistanceFixEnabled");
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
SetCameraDistance = (SetFloatFn)GetProcAddress(fixLib, "SetCameraDistance");
GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn");
GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV");
GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");;
SetConsole = (SetUEConsole)GetProcAddress(fixLib, "SetConsole");
GetConsoleEnabled = (GetBoolFn)GetProcAddress(fixLib, "GetConsoleEnabled");
// Apply initial values loaded from settings
if (SetFOV) SetFOV(worldFOVvalue);
if (SetCameraDistance) SetCameraDistance(cameraDistancevalue);
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true);
if (SetCameraDistanceFixEnabled) SetCameraDistanceFixEnabled(camera_distance_fix_enabled, true);
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, true);
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true);
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, true);
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true);
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
if (SetConsole) SetConsole();
}
SetFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFixEnabled");
SetFOVFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFOVFixEnabled");
SetAspectRatioFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetAspectRatioFixEnabled");
SetDOFFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDOFFixEnabled");
SetCAFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCAFixEnabled");
SetVignettingFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetVignettingFixEnabled");
SetFogFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFogFixEnabled");
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn");
GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV");
GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");;
// Apply initial values loaded from settings
if (SetFOV) SetFOV(worldFOVvalue);
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, true);
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, true);
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true);
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, true);
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true);
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
}
// Settings functions
@@ -96,11 +147,13 @@ static void SaveSettings()
file << GENERAL_FIX_SETTING << (fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_FIX_SETTING << (fov_fix_enabled ? "1" : "0") << "\n";
file << ASPECT_FIX_SETTING << (Aspect_fix_enabled ? "1" : "0") << "\n";
file << CAMERA_DISTANCE_FIX_SETTING << (camera_distance_fix_enabled ? "1" : "0") << "\n";
file << DOF_FIX_SETTING << (DOF_fix_enabled ? "1" : "0") << "\n";
file << CA_FIX_SETTING << (CA_fix_enabled ? "1" : "0") << "\n";
file << VIGNETTING_FIX_SETTING << (Vignetting_fix_enabled ? "1" : "0") << "\n";
file << FOG_FIX_SETTING << (Fog_fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_SETTING << worldFOVvalue << "\n";
file << CAMERA_DISTANCE_SETTING << cameraDistancevalue << "\n";
file.close();
}
}
@@ -123,6 +176,11 @@ static void LoadSettings()
std::string val = line.substr(strlen(WORLD_FOV_FIX_SETTING));
fov_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(CAMERA_DISTANCE_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(CAMERA_DISTANCE_FIX_SETTING));
camera_distance_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(ASPECT_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(ASPECT_FIX_SETTING));
@@ -150,142 +208,149 @@ static void LoadSettings()
}
else if (line.find(WORLD_FOV_SETTING) == 0)
worldFOVvalue = std::stoi(line.substr(strlen(WORLD_FOV_SETTING)));
else if (line.find(CAMERA_DISTANCE_SETTING) == 0)
cameraDistancevalue = std::stof(line.substr(strlen(CAMERA_DISTANCE_SETTING)));
}
file.close();
}
}
// Fix informations
static void displayFixInformations() {
ImGui::Begin("Informations", &popup_Informations); //
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::SetCursorPos(ImVec2(10, 76));
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
// Initialize ImGui widgets for Reshade
static void on_overlay_draw(reshade::api::effect_runtime* runtime)
{
ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_Once);
ImGui::SetNextWindowSize(ImVec2(350, 150), ImGuiCond_Once);
ImGuiStyle& style = ImGui::GetStyle();
style.ItemSpacing = ImVec2(8 * scale, 8 * scale); // Spacing between widgets
style.FramePadding = ImVec2(3 * scale, 3 * scale); // Widgets padding
style.WindowPadding = ImVec2(10 * scale, 10 * scale); // Overlay padding
style.CellPadding = ImVec2(10 * scale, 10 * scale); // Table cells padding
// Donation ?
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Like my work ?");
ImGui::SetCursorPos(ImVec2(130, 33));
if (ImGui::Button("consider donation"))
{
ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL);
}
ImGui::SetNextWindowSize(ImVec2(350 * scale, 150 * scale), ImGuiCond_Once);
// Fix informations
ImGui::SetCursorPos(ImVec2(270, 33));
if (ImGui::Button("Fix informations"))
popup_Informations = true;
if (ImGui::Button("Like my work ? Consider donation")) ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL); // Donation
ImGui::SameLine();
if (ImGui::Button("Fix informations")) popup_Informations = true; // Fix information
if (popup_Informations)
displayFixInformations();
// Generic fix
ImGui::SetCursorPos(ImVec2(10, 60));
ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
SaveSettings();
}
{
ImGui::Begin("Informations", &popup_Informations);
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
ImGui::EndChild();
// FOV adjustment
ImGui::SetCursorPos(ImVec2(10, 120));
ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false);
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::SetNextItemWidth(150.0f);
if (ImGui::SliderInt("", &worldFOVvalue, -20, 50)) {}
if (ImGui::IsItemDeactivatedAfterEdit()) {
if (SetFOV) SetFOV(worldFOVvalue);
SaveSettings();
}
}
ImGui::EndChild();
if (ImGui::BeginTable("FixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
ImGui::TableSetupColumn("LeftFix", ImGuiTableColumnFlags_WidthStretch, 0.4f);
ImGui::TableSetupColumn("RightFix", ImGuiTableColumnFlags_WidthStretch, 0.6f);
ImGui::TableNextRow();
// Individual fixes
ImGui::SetCursorPos(ImVec2(240, 60));
ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false);
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("FOV fix", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
// Drawing a left column with slider and general fix
ImGui::TableSetColumnIndex(0);
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen))
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
SaveSettings();
}
// Sliders
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::SetNextItemWidth(150 * scale);
if (ImGui::SliderInt("##FOVValue", &worldFOVvalue, -20, 50)) {
if (SetFOV) SetFOV(worldFOVvalue);
SaveSettings();
}
}
if (ImGui::CollapsingHeader("Camera distance (*)", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::SetNextItemWidth(150 * scale);
if (ImGui::SliderFloat("##CameraValue", &cameraDistancevalue, 0, 3)) {
if (SetCameraDistance) SetCameraDistance(cameraDistancevalue); SaveSettings();
}
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This won't affect PDA for readability");
ImGui::Text("Value is a multiplier.");
//ImGui::Text("Affects both normal and weapon aiming distance.");
ImGui::EndTooltip();
}
ImGui::SetCursorPos(ImVec2(90, 30));
if (ImGui::Checkbox("Aspect ratio fix", &Aspect_fix_enabled)) {
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, false);
SaveSettings();
}
// Individual fixes
ImGui::TableSetColumnIndex(1);
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
if (ImGui::BeginTable("IndividualFixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
ImGui::TableSetupColumn("IndFix1", ImGuiTableColumnFlags_WidthStretch, 0.35f);
ImGui::TableSetupColumn("IndFix2", ImGuiTableColumnFlags_WidthStretch, 0.65f);
ImGui::TableNextRow();
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Aspect ratio fix is only usefull for ultrawide displays.");
ImGui::Text("No need to enable it if you play at 16/9.");
ImGui::EndTooltip();
}
ImGui::TableSetColumnIndex(0);
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This won't affect PDA for readability");
ImGui::EndTooltip();
}
ImGui::SetCursorPos(ImVec2(5, 55));
if (ImGui::Checkbox("Depth of field fix", &DOF_fix_enabled)) {
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) {
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(5, 80));
if (ImGui::Checkbox("Chromatic aberrations fix", &CA_fix_enabled)) {
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Fog", &Fog_fix_enabled)) {
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Enabling this fix is a one way.");
ImGui::Text("Reverting it in real time would end in game crash.");
ImGui::Text("So disabling this fix is only possible by doing it here and restart the game.");
ImGui::EndTooltip();
}
ImGui::SetCursorPos(ImVec2(5, 105));
if (ImGui::Checkbox("Vignetting fix", &Vignetting_fix_enabled)) {
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false);
SaveSettings();
}
ImGui::TableSetColumnIndex(1);
if (ImGui::Checkbox("Aspect ratio", &Aspect_fix_enabled)) {
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Aspect ratio fix is only usefull for ultrawide displays.");
ImGui::Text("No need to enable it if you play at 16/9.");
ImGui::EndTooltip();
}
ImGui::SetCursorPos(ImVec2(140, 105));
if (ImGui::Checkbox("Fog fix", &Fog_fix_enabled)) {
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Camera distance", &camera_distance_fix_enabled)) {
if (SetCameraDistanceFixEnabled) SetCameraDistanceFixEnabled(camera_distance_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Enabling this fix is a one way.");
ImGui::Text("Reverting it in real time would end in game crash.");
ImGui::Text("So disabling this fix is only possible by doing it here and restart the game.");
ImGui::EndTooltip();
if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) {
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Chromatic aberrations", &CA_fix_enabled)) {
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, false);
SaveSettings();
}
ImGui::EndTable();
}
}
ImGui::EndTable();
}
ImGui::EndChild();
// Fix status
ImGui::SetCursorPos(ImVec2(10, 220));
ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true);
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
ImGui::Text("Screen width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
if (GetConsoleEnabled && GetConsoleEnabled())
ImGui::Text("Console enabled and bound to key F2");
if (GetFOVIn && GetCompensadedFOV && GetFOVOut)
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Compensated: %.2f, Out: %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
}
ImGui::EndChild();
}
// Main dll intrance

View File

@@ -7,6 +7,11 @@
#include <string>
#include <Windows.h>
// Screen informations
static int screenWidth = GetSystemMetrics(SM_CXSCREEN);
static int screenHeight = GetSystemMetrics(SM_CYSCREEN);
static float aspectRatio = (float)screenWidth / screenHeight;
// Core game dll functions declarations
typedef void (*SetBoolFn)(bool, bool);
typedef void (*SetIntFn)(int);
@@ -19,6 +24,7 @@ static SetBoolFn SetFPSFixEnabled = nullptr;
static SetBoolFn SetResolutionFixEnabled = nullptr;
static SetBoolFn SetAspectRatioFixEnabled = nullptr;
static SetBoolFn SetDOFFixEnabled = nullptr;
static SetBoolFn SetCAFixEnabled = nullptr;
static SetBoolFn SetVignettingFixEnabled = nullptr;
static SetBoolFn SetFogFixEnabled = nullptr;
static SetIntFn SetFOV = nullptr;
@@ -32,6 +38,7 @@ static bool FPS_fix_enabled = false;
static bool Resolution_fix_enabled = false;
static bool Aspect_fix_enabled = false;
static bool DOF_fix_enabled = false;
static bool CA_fix_enabled = false;
static bool Vignetting_fix_enabled = false;
static bool Fog_fix_enabled = false;
static bool fix_enabled = false;
@@ -47,13 +54,16 @@ const char* FPS_FIX_SETTING = "FPSFIX=";
const char* RESOLUTION_FIX_SETTING = "ResolutionFIX=";
const char* ASPECT_FIX_SETTING = "AspectFIX=";
const char* DOF_FIX_SETTING = "DOFFIX=";
const char* CA_FIX_SETTING = "ChromaticAberrationsFIX=";
const char* VIGNETTING_FIX_SETTING = "VignettingFIX=";
const char* FOG_FIX_SETTING = "FogFIX=";
const char* WORLD_FOV_SETTING = "WorldFOV=";
const char* FIX_VERSION = "1.0.2";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Unlock ultrawide resolutions.\n - Remove pillar boxing.\n - Unlock FPS.\n - Disable depth of field.\n - Disable vignetting.\n - Disable FOG.";
const char* FIX_VERSION = "1.0.3";
const char* FIX_INFORMATIONS = "This fix allows to:\n - Control FOV in game.\n - Unlock ultrawide resolutions.\n - Remove pillar boxing.\n - Unlock FPS.\n - Disable depth of field.\n - Disable chromatic aberrations.\n - Disable vignetting.\n - Disable FOG.";
const char* DONATION_URL = "https://buymeacoffee.com/k4sh44";
// Scaling factor based vertical resolution
float scale = 1.f;
// Load and unload game core dll functions /!\ necessary
static void LoadFixDLL()
@@ -73,6 +83,7 @@ static void LoadFixDLL()
SetResolutionFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetResolutionFixEnabled");
SetAspectRatioFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetAspectRatioFixEnabled");
SetDOFFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetDOFFixEnabled");
SetCAFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetCAFixEnabled");
SetVignettingFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetVignettingFixEnabled");
SetFogFixEnabled = (SetBoolFn)GetProcAddress(fixLib, "SetFogFixEnabled");
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
@@ -87,6 +98,7 @@ static void LoadFixDLL()
if (SetResolutionFixEnabled) SetResolutionFixEnabled(Resolution_fix_enabled, true);
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, true);
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, true);
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, true);
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true);
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
@@ -104,6 +116,7 @@ static void SaveSettings()
file << RESOLUTION_FIX_SETTING << (Resolution_fix_enabled ? "1" : "0") << "\n";
file << ASPECT_FIX_SETTING << (Aspect_fix_enabled ? "1" : "0") << "\n";
file << DOF_FIX_SETTING << (DOF_fix_enabled ? "1" : "0") << "\n";
file << CA_FIX_SETTING << (CA_fix_enabled ? "1" : "0") << "\n";
file << VIGNETTING_FIX_SETTING << (Vignetting_fix_enabled ? "1" : "0") << "\n";
file << FOG_FIX_SETTING << (Fog_fix_enabled ? "1" : "0") << "\n";
file << WORLD_FOV_SETTING << worldFOVvalue << "\n";
@@ -149,6 +162,11 @@ static void LoadSettings()
std::string val = line.substr(strlen(DOF_FIX_SETTING));
DOF_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(CA_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(CA_FIX_SETTING));
CA_fix_enabled = (val == "1" || val == "true");
}
else if (line.find(VIGNETTING_FIX_SETTING) == 0)
{
std::string val = line.substr(strlen(VIGNETTING_FIX_SETTING));
@@ -167,136 +185,125 @@ static void LoadSettings()
}
}
// Fix informations
static void displayFixInformations() {
ImGui::SetNextWindowSize(ImVec2(250, 200));
ImGui::Begin("Informations", &popup_Informations); //
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::SetCursorPos(ImVec2(10, 76));
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
// Initialize ImGui widgets for Reshade
static void on_overlay_draw(reshade::api::effect_runtime* runtime)
{
ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_Once);
ImGui::SetNextWindowSize(ImVec2(350, 150), ImGuiCond_Once);
ImGuiStyle& style = ImGui::GetStyle();
style.ItemSpacing = ImVec2(8 * scale, 8 * scale); // Spacing between widgets
style.FramePadding = ImVec2(3 * scale, 3 * scale); // Widgets padding
style.WindowPadding = ImVec2(10 * scale, 10 * scale); // Overlay padding
style.CellPadding = ImVec2(10 * scale, 10 * scale); // Table cells padding
ImGui::SetNextWindowSize(ImVec2(350 * scale, 150 * scale), ImGuiCond_Once);
// Donation ?
ImGui::SetCursorPos(ImVec2(10, 36));
ImGui::Text("Like my work ?");
ImGui::SetCursorPos(ImVec2(130, 33));
if (ImGui::Button("consider donation"))
{
ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL);
}
// Fix informations
ImGui::SetCursorPos(ImVec2(270, 33));
if (ImGui::Button("Fix informations"))
popup_Informations = true;
if (ImGui::Button("Like my work ? Consider donation")) ShellExecuteA(NULL, "open", DONATION_URL, NULL, NULL, SW_SHOWNORMAL);
ImGui::SameLine();
// Fix information
if (ImGui::Button("Fix informations")) popup_Informations = true;
if (popup_Informations)
displayFixInformations();
// Generic fix
ImGui::SetCursorPos(ImVec2(10, 60));
ImGui::BeginChild("AllFixesHeader", ImVec2(220, 0), false); // true = border
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
SaveSettings();
}
{
ImGui::Begin("Informations", &popup_Informations);
ImGui::Text("Version : %s", FIX_VERSION);
ImGui::Text(FIX_INFORMATIONS);
ImGui::End();
}
ImGui::EndChild();
// FOV adjustment
ImGui::SetCursorPos(ImVec2(10, 120));
ImGui::BeginChild("FOVHeader", ImVec2(220, 0), false);
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::SetNextItemWidth(150.0f);
if (ImGui::SliderInt("", &worldFOVvalue, -20, 50)) {}
if (ImGui::IsItemDeactivatedAfterEdit()) {
if (SetFOV) SetFOV(worldFOVvalue);
SaveSettings();
if (ImGui::BeginTable("FixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
ImGui::TableSetupColumn("LeftFix", ImGuiTableColumnFlags_WidthStretch, 0.4f);
ImGui::TableSetupColumn("RightFix", ImGuiTableColumnFlags_WidthStretch, 0.6f);
ImGui::TableNextRow();
// Drawing a left column with slider and general fix
ImGui::TableSetColumnIndex(0);
if (ImGui::CollapsingHeader("Enable fixes", ImGuiTreeNodeFlags_DefaultOpen))
if (ImGui::Checkbox("Fix enabled", &fix_enabled)) {
if (SetFixEnabled) SetFixEnabled(fix_enabled, false);
SaveSettings();
}
// Sliders
if (ImGui::CollapsingHeader("In game additional FOV", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::SetNextItemWidth(150 * scale);
if (ImGui::SliderInt("##FOVValue", &worldFOVvalue, -20, 50)) {
if (SetFOV) SetFOV(worldFOVvalue); SaveSettings();
}
}
// Individual fixes
ImGui::TableSetColumnIndex(1);
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
if (ImGui::BeginTable("IndividualFixesTable", 2, ImGuiTableFlags_SizingStretchSame)) {
ImGui::TableSetupColumn("IndFix1", ImGuiTableColumnFlags_WidthStretch, 0.35f);
ImGui::TableSetupColumn("IndFix2", ImGuiTableColumnFlags_WidthStretch, 0.65f);
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Frame time", &FPS_fix_enabled)) {
if (SetFPSFixEnabled) SetFPSFixEnabled(FPS_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) {
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Fog", &Fog_fix_enabled)) {
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Enabling this fix is a one way.");
ImGui::Text("Reverting it in real time would end in game crash.");
ImGui::Text("So disabling this fix is only possible by doing it here and restart the game.");
ImGui::EndTooltip();
}
ImGui::TableSetColumnIndex(1);
if (ImGui::Checkbox("Aspect ratio", &Aspect_fix_enabled)) {
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This fix is intended for ultrawide only.");
ImGui::EndTooltip();
}
if (ImGui::Checkbox("Resolution", &Resolution_fix_enabled)) {
if (SetResolutionFixEnabled) SetResolutionFixEnabled(Resolution_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) {
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
SaveSettings();
}
if (ImGui::Checkbox("Chromatic aberrations", &CA_fix_enabled)) {
if (SetCAFixEnabled) SetCAFixEnabled(CA_fix_enabled, false);
SaveSettings();
}
ImGui::EndTable();
}
}
ImGui::EndTable();
}
ImGui::EndChild();
// Individual fixes
ImGui::SetCursorPos(ImVec2(240, 60));
ImGui::BeginChild("IndividualFixesHeader", ImVec2(250, 0), false);
if (ImGui::CollapsingHeader("Individual fixes", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
if (ImGui::Checkbox("FOV", &fov_fix_enabled)) {
if (SetFOVFixEnabled) SetFOVFixEnabled(fov_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(5, 55));
if (ImGui::Checkbox("Frame time", &FPS_fix_enabled)) {
if (SetFPSFixEnabled) SetFPSFixEnabled(FPS_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(110, 55));
if (ImGui::Checkbox("Resolution", &Resolution_fix_enabled)) {
if (SetResolutionFixEnabled) SetResolutionFixEnabled(Resolution_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(5, 80));
if (ImGui::Checkbox("Aspect ratio fix", &Aspect_fix_enabled)) {
if (SetAspectRatioFixEnabled) SetAspectRatioFixEnabled(Aspect_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("This doesn't remove pillar boxing in cutscenes.");
ImGui::EndTooltip();
}
ImGui::SetCursorPos(ImVec2(5, 105));
if (ImGui::Checkbox("Depth of field", &DOF_fix_enabled)) {
if (SetDOFFixEnabled) SetDOFFixEnabled(DOF_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(5, 130));
if (ImGui::Checkbox("Vignetting", &Vignetting_fix_enabled)) {
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, false);
SaveSettings();
}
ImGui::SetCursorPos(ImVec2(110, 130));
if (ImGui::Checkbox("Fog", &Fog_fix_enabled)) {
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, false);
SaveSettings();
}
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Enabling this fix is a one way.");
ImGui::Text("Reverting it in real time would end in game crash.");
ImGui::Text("So disabling this fix is only possible by doing it here and restart the game.");
ImGui::EndTooltip();
}
}
ImGui::EndChild();
// Fix status
ImGui::SetCursorPos(ImVec2(10, 240));
ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true);
if (ImGui::CollapsingHeader("Fix informations", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::SetCursorPos(ImVec2(5, 30));
ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
ImGui::Text("Screen width: %d, height: %d, aspect ratio: %.2f", screenWidth, screenHeight, aspectRatio);
if (GetFOVIn && GetCompensadedFOV && GetFOVOut)
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Compensated: %.2f, Out: %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
}
ImGui::EndChild();
}
// Main dll intrance

View File

@@ -43,7 +43,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sword Of The Sea", "Sword O
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Metal Gear Solid Delta Snake Eater", "Metal Gear Solid Delta\MGSDelta.vcxproj", "{B0815637-8194-48E2-9862-3BA0D73FBEE5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Gears Of War Reloaded", "GOWR\GOWR.vcxproj", "{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cronos The New Dawn", "Cronos The New Dawn\CronosTND.vcxproj", "{CFE5F26D-A180-4ED1-B696-7985053B14BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -205,14 +205,14 @@ Global
{B0815637-8194-48E2-9862-3BA0D73FBEE5}.Release|x64.Build.0 = Release|x64
{B0815637-8194-48E2-9862-3BA0D73FBEE5}.Release|x86.ActiveCfg = Release|Win32
{B0815637-8194-48E2-9862-3BA0D73FBEE5}.Release|x86.Build.0 = Release|Win32
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Debug|x64.ActiveCfg = Debug|x64
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Debug|x64.Build.0 = Debug|x64
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Debug|x86.ActiveCfg = Debug|Win32
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Debug|x86.Build.0 = Debug|Win32
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Release|x64.ActiveCfg = Release|x64
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Release|x64.Build.0 = Release|x64
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Release|x86.ActiveCfg = Release|Win32
{6F54A5CD-8CB4-486B-B18B-ABA443100FB8}.Release|x86.Build.0 = Release|Win32
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Debug|x64.ActiveCfg = Debug|x64
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Debug|x64.Build.0 = Debug|x64
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Debug|x86.ActiveCfg = Debug|Win32
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Debug|x86.Build.0 = Debug|Win32
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Release|x64.ActiveCfg = Release|x64
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Release|x64.Build.0 = Release|x64
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Release|x86.ActiveCfg = Release|Win32
{CFE5F26D-A180-4ED1-B696-7985053B14BA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE