Add Unreal Engine re-enabling. Add fix informations

This commit is contained in:
2025-09-07 18:50:12 +02:00
parent 88950de211
commit 07dfc091aa

View File

@@ -5,12 +5,20 @@
#include <reshade.hpp>
#include <fstream>
#include <string>
#include <thread>
#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 float (*GetFloatFn)();
typedef bool (*GetBoolFn)();
typedef void (*SetUEConsole)();
static HMODULE fixLib = nullptr;
static SetBoolFn SetFixEnabled = nullptr;
@@ -25,6 +33,8 @@ static SetIntFn SetFOV = 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;
@@ -97,7 +107,9 @@ static void LoadFixDLL()
SetFOV = (SetIntFn)GetProcAddress(fixLib, "SetFOV");
GetFOVIn = (GetFloatFn)GetProcAddress(fixLib, "GetFOVIn");
GetCompensadedFOV = (GetFloatFn)GetProcAddress(fixLib, "GetCompensatedFOV");
GetFOVOut = (GetFloatFn)GetProcAddress(fixLib, "GetFOVOut");;
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);
@@ -107,6 +119,7 @@ static void LoadFixDLL()
if (SetVignettingFixEnabled) SetVignettingFixEnabled(Vignetting_fix_enabled, true);
if (SetFogFixEnabled) SetFogFixEnabled(Fog_fix_enabled, true);
if (SetFixEnabled) SetFixEnabled(fix_enabled, true);
if (SetConsole) SetConsole();
}
}
@@ -286,11 +299,17 @@ static void on_overlay_draw(reshade::api::effect_runtime* runtime)
// Fix status
ImGui::SetCursorPos(ImVec2(10, 240));
ImGui::BeginChild("INFOSHeader", ImVec2(480, 80), true);
ImGui::BeginChild("INFOSHeader", ImVec2(480, 85), 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::SetCursorPos(ImVec2(5, 45));
if (GetConsoleEnabled && GetConsoleEnabled())
ImGui::Text("Console enabled and binded to key Tilde");
ImGui::SetCursorPos(ImVec2(5, 60));
if (GetFOVIn && GetCompensadedFOV && GetFOVOut) // Test functions in case Core dll is not ready when called
ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
ImGui::TextColored(ImColor(48, 179, 25), "FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
//ImGui::Text("FOV In: %.2f, Compensated : %.2f, Out : %.2f", GetFOVIn(), GetCompensadedFOV(), GetFOVOut());
}
ImGui::EndChild();
}